diff --git a/s3_storage_provider.py b/s3_storage_provider.py index 547f29b..8047925 100644 --- a/s3_storage_provider.py +++ b/s3_storage_provider.py @@ -205,7 +205,7 @@ def s3_download_task(s3_client, bucket, key, extra_args, deferred, parent_logcon logger.info("Fetching %s from S3", key) try: - if extra_args["SSECustomerKey"] and extra_args["SSECustomerAlgorithm"]: + if "SSECustomerKey" in extra_args and "SSECustomerAlgorithm" in extra_args: resp = s3_client.get_object( Bucket=bucket, Key=key, diff --git a/scripts/s3_media_upload b/scripts/s3_media_upload index 07e83be..40a5772 100755 --- a/scripts/s3_media_upload +++ b/scripts/s3_media_upload @@ -171,7 +171,7 @@ def check_file_in_s3(s3, bucket, key, extra_args): """Check the file exists in S3 (though it could be different) """ try: - if extra_args["SSECustomerKey"] and extra_args["SSECustomerAlgorithm"]: + if "SSECustomerKey" in extra_args and "SSECustomerAlgorithm" in extra_args: s3.head_object( Bucket=bucket, Key=key,