Skip to content

Commit

Permalink
code review of Davide Principi
Browse files Browse the repository at this point in the history
Co-authored-by: Davide Principi <[email protected]>
  • Loading branch information
stephdl and DavidePrincipi authored May 13, 2024
1 parent 1e18f49 commit 5b818e4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions imageroot/bin/import-emails
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ parser.add_argument('-B', '--before', metavar='BEFORE_TIMESTAMP', type=str,

args = parser.parse_args()

timestamp = ''
timestamp = []

if args.after is not None:
print("Import emails after timestamp:", args.after, file=sys.stderr)
timestamp = '-A '+args.after
timestamp += ['-A', args.after]
elif args.before is not None:
print("Import emails before timestamp:", args.before, file=sys.stderr)
timestamp = '-B '+args.before
timestamp += ['-B', args.before]

rdb = agent.redis_connect()

Expand Down Expand Up @@ -56,7 +56,7 @@ if providers:

subprocess.run([
'/usr/bin/podman', 'exec', '-w', '/var/piler/imap', '-u', 'piler', 'piler-app',
'/usr/bin/pilerimport', '-Z', '200', timestamp , '-i', ip_address, '-u', f'{user}*vmail', '-p', password, '-P', '993'
'/usr/bin/pilerimport', '-Z', '200', *timestamp , '-i', ip_address, '-u', f'{user}*vmail', '-p', password, '-P', '993'
])
except Exception as e:
print(f"### Error to import {user} to {os.environ['MODULE_ID']}: {e}", file=sys.stderr)
Expand Down

0 comments on commit 5b818e4

Please sign in to comment.