def get_user_pubkeys(users):
 if (not isinstance(users, list)):
  return {'Error': 'A list of users is expected'}
 ret = {}
 for user in users:
  key_ids = []
  if isinstance(user, dict):
   tmp_user = next(six.iterkeys(user))
   key_ids = user[tmp_user]
   user = tmp_user
  url = 'https://api.github.com/users/{0}/keys'.format(user)
  result = salt.utils.http.query(url, 'GET', decode=False, text=True)
  keys = json.loads(result['text'])
  ret[user] = {}
  for key in keys:
   if (len(key_ids) > 0):
    if (str(key['id']) in key_ids):
     ret[user][key['id']] = key['key']
   else:
    ret[user][key['id']] = key['key']
 return ret

def get_user_pubkeys ( users ) : if ( not isinstance ( users , list ) ) : return { 'Error' : 'A list of users is expected' } ret = { } for user in users : key_ids = [ ] if isinstance ( user , dict ) : tmp_user = next ( six . iterkeys ( user ) ) key_ids = user [ tmp_user ] user = tmp_user url = 'https://api.github.com/users/{0}/keys' . format ( user ) result = salt . utils . http . query ( url , 'GET' , decode = False , text = True ) keys = json . loads ( result [ 'text' ] ) ret [ user ] = { } for key in keys : if ( len ( key_ids ) > 0 ) : if ( str ( key [ 'id' ] ) in key_ids ) : ret [ user ] [ key [ 'id' ] ] = key [ 'key' ] else : ret [ user ] [ key [ 'id' ] ] = key [ 'key' ] return ret
retrieve a set of public keys from github for the specified list of users .