

def add(name, uid=None, gid=None, groups=None, home=None, shell=None, fullname=None, createhome=True, **kwargs):
    "\n    Add a user to the minion\n\n    CLI Example:\n\n    .. code-block:: bash\n\n        salt '*' user.add name <uid> <gid> <groups> <home> <shell>\n    "
    if info(name):
        raise CommandExecutionError("User '{0}' already exists".format(name))
    if salt.utils.contains_whitespace(name):
        raise SaltInvocationError('Username cannot contain whitespace')
    if (uid is None):
        uid = _first_avail_uid()
    if (gid is None):
        gid = 20
    if (home is None):
        home = '/Users/{0}'.format(name)
    if (shell is None):
        shell = '/bin/bash'
    if (fullname is None):
        fullname = ''
    if (not isinstance(uid, int)):
        raise SaltInvocationError('uid must be an integer')
    if (not isinstance(gid, int)):
        raise SaltInvocationError('gid must be an integer')
    name_path = '/Users/{0}'.format(name)
    _dscl([uid, 'UniqueID', uid])
    _dscl([name_path, 'PrimaryGroupID', gid])
    _dscl([name_path, 'UserShell', shell])
    _dscl([name_path, 'NFSHomeDirectory', home])
    _dscl([name_path, 'RealName', fullname])
    if createhome:
        __salt__['file.mkdir'](home, user=uid, group=gid)
    time.sleep(1)
    if groups:
        chgroups(name, groups)
    return True

dataset/ETHPy150Open saltstack/salt/salt/modules/mac_user.py add/VarMisuse@211/368 `name_path`->`uid`