Example #1
0
def history_cleanup(env, node=None):
    """
    Clear fencing history

    LibraryEnvironment env
    string node -- clear history for the specified node or all nodes if None
    """
    if not is_fence_history_supported():
        raise LibraryError(reports.fence_history_not_supported())

    try:
        return fence_history_cleanup(env.cmd_runner(), node)
    except FenceHistoryCommandErrorException as e:
        raise LibraryError(
            reports.fence_history_command_error(str(e), "cleanup"))
Example #2
0
def history_cleanup(env: LibraryEnvironment, node: Optional[str] = None):
    """
    Clear fencing history

    env
    node -- clear history for the specified node or all nodes if None
    """
    runner = env.cmd_runner()
    if not is_fence_history_supported_management(runner):
        raise LibraryError(reports.fence_history_not_supported())

    try:
        return fence_history_cleanup(runner, node)
    except FenceHistoryCommandErrorException as e:
        raise LibraryError(
            reports.fence_history_command_error(str(e), "cleanup"))
Example #3
0
def history_cleanup(env, node=None):
    """
    Clear fencing history

    LibraryEnvironment env
    string node -- clear history for the specified node or all nodes if None
    """
    if not is_fence_history_supported():
        raise LibraryError(reports.fence_history_not_supported())

    try:
        return fence_history_cleanup(env.cmd_runner(), node)
    except FenceHistoryCommandErrorException as e:
        raise LibraryError(
            reports.fence_history_command_error(str(e), "cleanup")
        )
Example #4
0
def history_cleanup(env: LibraryEnvironment, node: Optional[str] = None):
    """
    Clear fencing history

    env
    node -- clear history for the specified node or all nodes if None
    """
    runner = env.cmd_runner()
    if not is_fence_history_supported_management(runner):
        raise LibraryError(
            ReportItem.error(reports.messages.FenceHistoryNotSupported()))

    try:
        return fence_history_cleanup(runner, node)
    except FenceHistoryCommandErrorException as e:
        raise LibraryError(
            ReportItem.error(
                reports.messages.FenceHistoryCommandError(
                    str(e), reports.const.FENCE_HISTORY_COMMAND_CLEANUP)))