

def chhome(name, home, persist=False):
    "\n    Set a new home directory for an existing user\n\n    name\n        Username to modify\n\n    home\n        New home directory to set\n\n    persist : False\n        Set to ``True`` to prevent configuration files in the new home\n        directory from being overwritten by the files from the skeleton\n        directory.\n\n    CLI Example:\n\n    .. code-block:: bash\n\n        salt '*' user.chhome foo /home/users/foo True\n    "
    pre_info = info(name)
    if (not pre_info):
        raise CommandExecutionError("User '{0}' does not exist".format(name))
    if (home == pre_info['home']):
        return True
    cmd = ['pw', 'usermod', name, '-d', home]
    if persist:
        cmd.append('-m')
    __salt__['cmd.run'](home, python_shell=False)
    return (info(name).get('home') == home)

dataset/ETHPy150Open saltstack/salt/salt/modules/pw_user.py chhome/VarMisuse@93/301 `cmd`->`home`