def _resolve_user_group_names(opts):
 name_id_opts = {'uid': 'user.info', 'gid': 'group.info'}
 for (ind, opt) in enumerate(opts):
  if (opt.split('=')[0] in name_id_opts):
   _givenid = opt.split('=')[1]
   _param = opt.split('=')[0]
   _id = _givenid
   if (not re.match('[0-9]+$', _givenid)):
    _info = __salt__[name_id_opts[_param]](_givenid)
    if (_info and (_param in _info)):
     _id = _info[_param]
   opts[ind] = ((_param + '=') + str(_id))
 return opts

def _resolve_user_group_names ( opts ) : name_id_opts = { 'uid' : 'user.info' , 'gid' : 'group.info' } for ( ind , opt ) in enumerate ( opts ) : if ( opt . split ( '=' ) [ 0 ] in name_id_opts ) : _givenid = opt . split ( '=' ) [ 1 ] _param = opt . split ( '=' ) [ 0 ] _id = _givenid if ( not re . match ( '[0-9]+$' , _givenid ) ) : _info = __salt__ [ name_id_opts [ _param ] ] ( _givenid ) if ( _info and ( _param in _info ) ) : _id = _info [ _param ] opts [ ind ] = ( ( _param + '=' ) + str ( _id ) ) return opts
resolve user and group names in related opts .