def display_s3_bucket_validations_table(self, bucketlist):
'''
List the S3 buckets and the validation results in tabular format
'''
# Setup Table.
header = ["Bucket Name", "Profile",
"Naming Policy", "Tag Validation",
"Result"]
table = prettytable.PrettyTable(header)
for bucket in bucketlist:
name = bucket['Name']
profile = bucket['profile_name'][0]
naming_policy = bucket['validations']['nameresult']
tag_policy = textwrap.fill(bucket['validations']['tagresult'],
40)
result = bucket['validations']['result']
row = [name, profile, naming_policy, tag_policy, result]
table.add_row(row)
print table
评论列表
文章目录