def chhome(name, home, persist=False):
    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 = ['usermod', '-d', home]
    if persist:
        cmd.append('-m')
    cmd.append(name)
    __salt__['cmd.run'](cmd, python_shell=False)
    return info(name).get('home') == home
Set a new home directory for an existing user
dataset/ETHPy150Open saltstack/salt/salt/modules/solaris_user.py/chhome