This function is used to remember that an event indicating that a reboot is
    required was witnessed. This function writes to a temporary filesystem so
    the event gets cleared upon reboot.

    Returns:
        bool: ``True`` if successful, otherwise ``False``

    .. code-block:: bash

        salt '*' system.set_reboot_required_witnessed

def set_reboot_required_witnessed():
    '''
    This function is used to remember that an event indicating that a reboot is
    required was witnessed. This function writes to a temporary filesystem so
    the event gets cleared upon reboot.

    Returns:
        bool: ``True`` if successful, otherwise ``False``

    .. code-block:: bash

        salt '*' system.set_reboot_required_witnessed
    '''
    errcode = -1
    dir_path = os.path.dirname(NILRT_REBOOT_WITNESS_PATH)
    if not os.path.exists(dir_path):
        try:
            os.makedirs(dir_path)
        except OSError as ex:
            raise SaltInvocationError('Error creating {0} (-{1}): {2}'
                                      .format(dir_path, ex.errno, ex.strerror))

        rdict = __salt__['cmd.run_all']('touch {0}'.format(NILRT_REBOOT_WITNESS_PATH))
        errcode = rdict['retcode']

    return errcode == 0