def get_user_policy(user_name, policy_name, region=None, key=None, keyid=None, profile=None):
 conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
 try:
  info = conn.get_user_policy(user_name, policy_name)
  log.debug('Info for user policy is : {0}.'.format(info))
  if (not info):
   return False
  info = info.get_user_policy_response.get_user_policy_result.policy_document
  info = _unquote(info)
  info = json.loads(info, object_pairs_hook=odict.OrderedDict)
  return info
 except boto.exception.BotoServerError as e:
  log.debug(e)
  msg = 'Failed to get user {0} policy.'
  log.error(msg.format(user_name))
  return False

def get_user_policy ( user_name , policy_name , region = None , key = None , keyid = None , profile = None ) : conn = _get_conn ( region = region , key = key , keyid = keyid , profile = profile ) try : info = conn . get_user_policy ( user_name , policy_name ) log . debug ( 'Info for user policy is : {0}.' . format ( info ) ) if ( not info ) : return False info = info . get_user_policy_response . get_user_policy_result . policy_document info = _unquote ( info ) info = json . loads ( info , object_pairs_hook = odict . OrderedDict ) return info except boto . exception . BotoServerError as e : log . debug ( e ) msg = 'Failed to get user {0} policy.' log . error ( msg . format ( user_name ) ) return False
retrieves the specified policy document for the specified user .