def chshell(name, shell):
    pre_info = info(name)
    if not pre_info:
        raise CommandExecutionError(
            'User \'{0}\' does not exist'.format(name)
        )
    if shell == pre_info['shell']:
        return True
    cmd = ['pw', 'usermod', '-s', shell, '-n', name]
    __salt__['cmd.run'](cmd, python_shell=False)
    return info(name).get('shell') == shell
Change the default shell of the user
dataset/ETHPy150Open saltstack/salt/salt/modules/pw_user.py/chshell