#NEWLINE# def conv_bucket_to_dict( self , bhandle , account , region , bucket_name , exception_map ) : #NEWLINE# #INDENT# '\n        Converts the bucket ACL and Policy information into a python dict that we can save.\n        ' #NEWLINE# bucket_dict = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# grantees = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# acl = self . wrap_aws_rate_limited_call ( bhandle . get_acl ) #NEWLINE# aclxml = self . wrap_aws_rate_limited_call ( acl . to_xml ) #NEWLINE# if ( '<DisplayName>None</DisplayName>' in aclxml ) : #NEWLINE# #INDENT# exc = S3ACLReturnedNoneDisplayName ( bucket_name ) #NEWLINE# self . slurp_exception ( ( self . index , account , region , bucket_name ) , exc , exception_map ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# for grant in acl . acl . grants : #NEWLINE# #INDENT# if ( ( grant . display_name == 'None' ) or ( grant . display_name == 'null' ) ) : #NEWLINE# #INDENT# app . logger . info ( ( 'Received a bad display name: %s' % grant . display_name ) ) #NEWLINE# #UNINDENT# if ( grant . display_name is None ) : #NEWLINE# #INDENT# gname = grant . uri #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# gname = grant . display_name #NEWLINE# #UNINDENT# if ( gname in grantees ) : #NEWLINE# #INDENT# grantees [ gname ] . append ( grant . permission ) #NEWLINE# grantees [ gname ] = sorted ( aclxml [ gname ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# grantees [ gname ] = [ grant . permission ] #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# bucket_dict [ 'grants' ] = grantees #NEWLINE# try : #NEWLINE# #INDENT# policy = self . wrap_aws_rate_limited_call ( bhandle . get_policy ) #NEWLINE# policy = json . loads ( policy ) #NEWLINE# bucket_dict [ 'policy' ] = policy #NEWLINE# #UNINDENT# except boto . exception . S3ResponseError as e : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# bucket_dict [ 'versioning' ] = self . wrap_aws_rate_limited_call ( bhandle . get_versioning_status ) #NEWLINE# bucket_dict [ 'lifecycle_rules' ] = get_lifecycle_rules ( bhandle ) #NEWLINE# bucket_dict [ 'logging' ] = get_logging ( bhandle ) #NEWLINE# return bucket_dict