Skip to content

Commit 51421b0

Browse files
Enrico Usaienrico-usai
authored andcommitted
Fix upload-cookbook script by adding region in s3 client creation
+ Add some debug messages Signed-off-by: Enrico Usai <[email protected]>
1 parent 4858ade commit 51421b0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

util/upload-cookbook.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def _create_s3_client(region):
119119
print("Warning: non authorized in region '{0}', skipping".format(credential_region))
120120
raise e
121121
else:
122-
s3 = boto3.client("s3")
122+
s3 = boto3.client("s3", region_name=region)
123123
return s3
124124

125125

@@ -207,8 +207,9 @@ def main():
207207
s3 = _create_s3_client(region)
208208
bucket_name = _get_bucket_name(args, region)
209209

210-
print("Listing cookbook for region ({0})".format(region))
211-
_aws_s3_ls(s3, region, bucket_name, _COOKBOOKS_DIR + "/" + args.full_name + ".tgz")
210+
s3_key = _COOKBOOKS_DIR + "/" + args.full_name + ".tgz"
211+
print("Listing cookbook for region: {0}, bucket: {1}, key: {2}".format(region, bucket_name, s3_key))
212+
_aws_s3_ls(s3, region, bucket_name, s3_key)
212213

213214
if len(_ls_error_array) > 0 and not args.override:
214215
print("We know the cookbook archives are already there, in this round we need to upload the .date files!")

0 commit comments

Comments
 (0)