

def chuid(name, uid):
    "\n    Change the uid for a named user\n\n    CLI Example:\n\n    .. code-block:: bash\n\n        salt '*' user.chuid foo 4376\n    "
    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)

dataset/ETHPy150Open saltstack/salt/salt/modules/pw_user.py chuid/original