Skip to content

Commit

Permalink
Strip trailing / from aws:s3:prefix. Fixes #159
Browse files Browse the repository at this point in the history
  • Loading branch information
asparke2 committed May 27, 2020
1 parent 15701e2 commit 3d8825a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion buildstockbatch/postprocessing.py
Expand Up @@ -382,7 +382,7 @@ def upload_results(aws_conf, output_dir, results_dir):
for files in parquet_dir.rglob('*.parquet'):
all_files.append(files.relative_to(parquet_dir))

s3_prefix = aws_conf.get('s3', {}).get('prefix', None)
s3_prefix = aws_conf.get('s3', {}).get('prefix', None).rstrip('/')

This comment has been minimized.

Copy link
@rajeee

rajeee Jun 10, 2020

Contributor

Make it: aws_conf.get('s3', {}).get('prefix', '').rstrip('/') so it doesn't crash when prefix entry is missing.

s3_bucket = aws_conf.get('s3', {}).get('bucket', None)
if not (s3_prefix and s3_bucket):
logger.error("YAML file missing postprocessing:aws:s3:prefix and/or bucket entry.")
Expand Down

0 comments on commit 3d8825a

Please sign in to comment.