def user_exists_in_group(user_name, group_name, region=None, key=None, keyid=None, profile=None):
 users = get_group_members(group_name=group_name, region=region, key=key, keyid=keyid, profile=profile)
 if users:
  for _user in users:
   if (user_name == _user['user_name']):
    msg = 'Username : {0} is already in group {1}.'
    log.info(msg.format(user_name, group_name))
    return True
 return False

def user_exists_in_group ( user_name , group_name , region = None , key = None , keyid = None , profile = None ) : users = get_group_members ( group_name = group_name , region = region , key = key , keyid = keyid , profile = profile ) if users : for _user in users : if ( user_name == _user [ 'user_name' ] ) : msg = 'Username : {0} is already in group {1}.' log . info ( msg . format ( user_name , group_name ) ) return True return False
check if user exists in group .