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