Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for region in region_list:
- s3 = boto3.resource('s3', region)
- s3_client = boto3.client('s3', region)
- for bucket in s3.buckets.all():
- s3_bucket = bucket
- s3_bucket_name = s3_bucket.name
- response = s3_client.get_bucket_tagging(Bucket=s3_bucket_name)
- tagset = response['TagSet']
- if len(response['TagSet'])==0:
- print "s3 bucket not have tags, adding tags"
- else:
- pass
- Traceback (most recent call last):
- File "C:Python27ec2info.py", line 235, in <module>
- response = s3_client.get_bucket_tagging(Bucket=s3_bucket_name)
- File "C:Python27libsite-packagesbotocoreclient.py", line 314, in
- _api_call
- return self._make_api_call(operation_name, kwargs)
- File "C:Python27libsite-packagesbotocoreclient.py", line 612, in
- _make_api_call
- raise error_class(parsed_response, operation_name)
- ClientError: An error occurred (NoSuchTagSet) when calling the
- GetBucketTagging operation: The TagSet does not exist
Add Comment
Please, Sign In to add comment