Set a parameter in /etc/shadow

def _set_attrib(name, key, value, param, root=None, validate=True):
    '''
    Set a parameter in /etc/shadow
    '''
    pre_info = info(name, root=root)

    # If the user is not present or the attribute is already present,
    # we return early
    if not pre_info['name']:
        return False

    if value == pre_info[key]:
        return True

    cmd = ['chage']

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

    cmd.extend((param, value, name))

    ret = not __salt__['cmd.run'](cmd, python_shell=False)
    if validate:
        ret = info(name, root=root).get(key) == value
    return ret