try:
if s3.meta.client.upload_file(fileLocation, bucket_name, objectName) is True:
print("Upload log file to s3 bucket")
else:
print('Upload file to s3 bucket failed')
return False
except s3.exceptions:
print("known error occured")
except ClientError as e:
print("Unexpected error: %s" % e)
我运行这段代码,但随后它打印出来Upload file to s3 bucket failed,没有发生异常,所以我不知道为什么它失败了。自从我从所有现有存储桶列表中获取了存储桶名称以来,s3 存储桶就存在了。
天涯尽头无女友
相关分类