.. versionadded:: 2016.11.0

    Unlock the password from name user

    name
        User to unlock

    root
        Directory to chroot into

    CLI Example:

    .. code-block:: bash

        salt '*' shadow.unlock_password username

def unlock_password(name, root=None):
    '''
    .. versionadded:: 2016.11.0

    Unlock the password from name user

    name
        User to unlock

    root
        Directory to chroot into

    CLI Example:

    .. code-block:: bash

        salt '*' shadow.unlock_password username
    '''
    pre_info = info(name, root=root)
    if not pre_info['name']:
        return False

    if not pre_info['passwd'].startswith('!'):
        return True

    cmd = ['passwd']

    if root is not None:
        cmd.extend(('-R', root))

    cmd.extend(('-u', name))

    __salt__['cmd.run'](cmd, python_shell=False)
    return not info(name, root=root)['passwd'].startswith('!')