def describe_role(name, region=None, key=None, keyid=None, profile=None):
 conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
 try:
  info = conn.get_role(name)
  if (not info):
   return False
  role = info.get_role_response.get_role_result.role
  role['assume_role_policy_document'] = json.loads(_unquote(role.assume_role_policy_document))
  for (policy_key, policy) in role['assume_role_policy_document'].items():
   if (policy_key == 'Statement'):
    for val in policy:
     if (('Sid' in val) and (not val['Sid'])):
      del val['Sid']
  return role
 except boto.exception.BotoServerError as e:
  log.debug(e)
  msg = 'Failed to get {0} information.'
  log.error(msg.format(name))
  return False

def describe_role ( name , region = None , key = None , keyid = None , profile = None ) : conn = _get_conn ( region = region , key = key , keyid = keyid , profile = profile ) try : info = conn . get_role ( name ) if ( not info ) : return False role = info . get_role_response . get_role_result . role role [ 'assume_role_policy_document' ] = json . loads ( _unquote ( role . assume_role_policy_document ) ) for ( policy_key , policy ) in role [ 'assume_role_policy_document' ] . items ( ) : if ( policy_key == 'Statement' ) : for val in policy : if ( ( 'Sid' in val ) and ( not val [ 'Sid' ] ) ) : del val [ 'Sid' ] return role except boto . exception . BotoServerError as e : log . debug ( e ) msg = 'Failed to get {0} information.' log . error ( msg . format ( name ) ) return False
get information for a role .