Skip to content

Commit

Permalink
fix issue with second run on s3 logs
Browse files Browse the repository at this point in the history
  • Loading branch information
ssalinas committed Mar 31, 2015
1 parent 9214895 commit cb269f6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/logfetch/s3_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def download_s3_logs(args):
logs = logs_for_all_requests(args)
async_requests = []
zipped_files = []
all_logs = []
for log_file in logs:
filename = log_file['key'].rsplit("/", 1)[1]
if logfetch_base.is_in_date_range(args, time_from_filename(filename)):
Expand All @@ -26,6 +27,7 @@ def download_s3_logs(args):
else:
if args.verbose:
sys.stderr.write(colored('Log already downloaded {0}'.format(filename), 'magenta') + '\n')
all_logs.append('{0}/{1}'.format(args.dest, filename.replace('.gz', '.log')))
zipped_files.append('{0}/{1}'.format(args.dest, filename))
else:
if args.verbose:
Expand All @@ -36,7 +38,7 @@ def download_s3_logs(args):
else:
sys.stderr.write(colored('No S3 logs to download', 'cyan'))
sys.stderr.write(colored('\nUnpacking S3 logs\n', 'cyan'))
all_logs = logfetch_base.unpack_logs(args, zipped_files)
all_logs = all_logs + logfetch_base.unpack_logs(args, zipped_files)
sys.stderr.write(colored('All S3 logs up to date', 'cyan') + '\n')
return all_logs

Expand Down

0 comments on commit cb269f6

Please sign in to comment.