Пример #1
0
def sbd_check_success(node):
    """
    info that SBD pre-enabling check finished without issues on specified node

    node -- node name
    """
    return ReportItem.info(report_codes.SBD_CHECK_SUCCESS, info={"node": node})
Пример #2
0
def qdevice_certificate_removal_started():
    """
    Qdevice certificates are about to be removed from nodes
    """
    return ReportItem.info(
        report_codes.QDEVICE_CERTIFICATE_REMOVAL_STARTED,
    )
Пример #3
0
def qdevice_certificate_distribution_started():
    """
    Qdevice certificates are about to be set up on nodes
    """
    return ReportItem.info(
        report_codes.QDEVICE_CERTIFICATE_DISTRIBUTION_STARTED,
    )
Пример #4
0
def sbd_config_distribution_started():
    """
    distribution of SBD configuration started
    """
    return ReportItem.info(
        report_codes.SBD_CONFIG_DISTRIBUTION_STARTED,
    )
Пример #5
0
def corosync_not_running_on_node_ok(node):
    """
    corosync is not running on a node, which is ok
    node string node address / name
    """
    return ReportItem.info(report_codes.COROSYNC_NOT_RUNNING_ON_NODE,
                           info={"node": node})
Пример #6
0
def corosync_config_reloaded():
    """
    corosync configuration has been reloaded
    """
    return ReportItem.info(
        report_codes.COROSYNC_CONFIG_RELOADED,
    )
Пример #7
0
def booth_config_distribution_started():
    """
    booth configuration is about to be sent to nodes
    """
    return ReportItem.info(
        report_codes.BOOTH_CONFIG_DISTRIBUTION_STARTED,
    )
Пример #8
0
def sbd_disabling_started():
    """
    disabling SBD service started
    """
    return ReportItem.info(
        report_codes.SBD_DISABLING_STARTED,
    )
Пример #9
0
def sbd_enabling_started():
    """
    enabling SBD service started
    """
    return ReportItem.info(
        report_codes.SBD_ENABLING_STARTED,
    )
Пример #10
0
def cib_upgrade_successful():
    """
    Upgrade of CIB schema was successful.
    """
    return ReportItem.info(
        report_codes.CIB_UPGRADE_SUCCESSFUL,
    )
Пример #11
0
 def report_item_generator(i):
     if i == 1:
         raise NodeConnectionException("node", "command", "reason")
     elif i == 2:
         raise LibraryError(
             ReportItem.error(report_codes.COMMON_ERROR, ),
             ReportItem.info(report_codes.COMMON_INFO, ))
Пример #12
0
def corosync_not_running_check_started():
    """
    we are about to make sure corosync is not running on nodes
    """
    return ReportItem.info(
        report_codes.COROSYNC_NOT_RUNNING_CHECK_STARTED,
    )
Пример #13
0
def booth_config_saved(node=None, name_list=None):
    """
    Booth config has been saved on specified node.

    node -- name of node
    name_list -- list of names of booth instance
    """
    if name_list:
        name = ", ".join(name_list)
        if name == "booth":
            msg = "Booth config saved."
        else:
            msg = "Booth config(s) ({name}) saved."
    else:
        msg = "Booth config saved."
        name = None
    return ReportItem.info(
        report_codes.BOOTH_CONFIGS_SAVED_ON_NODE,
        msg if node is None else "{node}: " + msg,
        info={
            "node": node,
            "name": name,
            "name_list": name_list
        }
    )
Пример #14
0
def corosync_config_distribution_started():
    """
    corosync configuration is about to be sent to nodes
    """
    return ReportItem.info(
        report_codes.COROSYNC_CONFIG_DISTRIBUTION_STARTED,
    )
Пример #15
0
def qdevice_client_reload_started():
    """
    qdevice client configuration is about to be reloaded on nodes
    """
    return ReportItem.info(
        report_codes.QDEVICE_CLIENT_RELOAD_STARTED,
    )
Пример #16
0
def corosync_config_accepted_by_node(node):
    """
    corosync configuration has been accepted by a node
    node string node address / name
    """
    return ReportItem.info(report_codes.COROSYNC_CONFIG_ACCEPTED_BY_NODE,
                           info={"node": node})
Пример #17
0
def sbd_check_started():
    """
    info that SBD pre-enabling checks started
    """
    return ReportItem.info(
        report_codes.SBD_CHECK_STARTED,
    )
Пример #18
0
def qdevice_certificate_removed_from_node(node):
    """
    Qdevice certificates have been removed from a node
    string node node on which certificates have been deleted
    """
    return ReportItem.info(report_codes.QDEVICE_CERTIFICATE_REMOVED_FROM_NODE,
                           info={"node": node})
Пример #19
0
def qdevice_certificate_accepted_by_node(node):
    """
    Qdevice certificates have been saved to a node
    string node node on which certificates have been saved
    """
    return ReportItem.info(report_codes.QDEVICE_CERTIFICATE_ACCEPTED_BY_NODE,
                           info={"node": node})
Пример #20
0
def sbd_config_accepted_by_node(node):
    """
    info that SBD configuration has been saved successfully on specified node

    node -- node name
    """
    return ReportItem.info(report_codes.SBD_CONFIG_ACCEPTED_BY_NODE,
                           info={"node": node})
Пример #21
0
def cib_upgrade_successful():
    """
    Upgrade of CIB schema was successful.
    """
    return ReportItem.info(
        report_codes.CIB_UPGRADE_SUCCESSFUL,
        "CIB has been upgraded to the latest schema version."
    )
Пример #22
0
def qdevice_destroy_success(model):
    """
    qdevice configuration successfully removed from local host
    string model qdevice model
    """
    return ReportItem.info(report_codes.QDEVICE_DESTROY_SUCCESS,
                           info={
                               "model": model,
                           })
Пример #23
0
def qdevice_initialization_success(model):
    """
    qdevice was successfully initialized on local host
    string model qdevice model
    """
    return ReportItem.info(report_codes.QDEVICE_INITIALIZATION_SUCCESS,
                           info={
                               "model": model,
                           })
Пример #24
0
def service_kill_success(services):
    """
    system services were killed successfully
    iterable services services name or description
    """
    return ReportItem.info(report_codes.SERVICE_KILL_SUCCESS,
                           info={
                               "services": services,
                           })
Пример #25
0
def corosync_config_accepted_by_node(node):
    """
    corosync configuration has been accepted by a node
    node string node address / name
    """
    return ReportItem.info(
        report_codes.COROSYNC_CONFIG_ACCEPTED_BY_NODE,
        info={"node": node}
    )
Пример #26
0
def qdevice_certificate_accepted_by_node(node):
    """
    Qdevice certificates have been saved to a node
    string node node on which certificates have been saved
    """
    return ReportItem.info(
        report_codes.QDEVICE_CERTIFICATE_ACCEPTED_BY_NODE,
        info={"node": node}
    )
Пример #27
0
def qdevice_certificate_removed_from_node(node):
    """
    Qdevice certificates have been removed from a node
    string node node on which certificates have been deleted
    """
    return ReportItem.info(
        report_codes.QDEVICE_CERTIFICATE_REMOVED_FROM_NODE,
        info={"node": node}
    )
Пример #28
0
def common_info(text):
    # TODO replace by more specific reports
    """
    unspecified info with text message, do not use unless absolutely necessary
    """
    return ReportItem.info(
        report_codes.COMMON_INFO,
        info={"text": text}
    )
Пример #29
0
def corosync_not_running_on_node_ok(node):
    """
    corosync is not running on a node, which is ok
    node string node address / name
    """
    return ReportItem.info(
        report_codes.COROSYNC_NOT_RUNNING_ON_NODE,
        info={"node": node}
    )
Пример #30
0
def sbd_config_accepted_by_node(node):
    """
    info that SBD configuration has been saved successfully on specified node

    node -- node name
    """
    return ReportItem.info(
        report_codes.SBD_CONFIG_ACCEPTED_BY_NODE,
        info={"node": node}
    )
Пример #31
0
def sbd_check_success(node):
    """
    info that SBD pre-enabling check finished without issues on specified node

    node -- node name
    """
    return ReportItem.info(
        report_codes.SBD_CHECK_SUCCESS,
        info={"node": node}
    )
Пример #32
0
def qdevice_destroy_success(model):
    """
    qdevice configuration successfully removed from local host
    string model qdevice model
    """
    return ReportItem.info(
        report_codes.QDEVICE_DESTROY_SUCCESS,
        info={
            "model": model,
        }
    )
Пример #33
0
def service_start_started(service, instance=None):
    """
    system service is being started
    string service service name or description
    string instance instance of service
    """
    return ReportItem.info(report_codes.SERVICE_START_STARTED,
                           info={
                               "service": service,
                               "instance": instance,
                           })
Пример #34
0
def service_kill_success(services):
    """
    system services were killed successfully
    iterable services services name or description
    """
    return ReportItem.info(
        report_codes.SERVICE_KILL_SUCCESS,
        info={
            "services": services,
        }
    )
Пример #35
0
def booth_sending_local_configs_to_node(node):
    """
    Sending all local booth configs to node

    node -- node name
    """
    return ReportItem.info(
        report_codes.BOOTH_CONFIGS_SAVING_ON_NODE,
        "{node}: Saving booth config(s)...",
        info={"node": node}
    )
Пример #36
0
def qdevice_initialization_success(model):
    """
    qdevice was successfully initialized on local host
    string model qdevice model
    """
    return ReportItem.info(
        report_codes.QDEVICE_INITIALIZATION_SUCCESS,
        info={
            "model": model,
        }
    )
Пример #37
0
def booth_fetching_config_from_node_started(node, config=None):
    """
    fetching of booth config from specified node started

    node -- node from which config is fetching
    config -- config name
    """
    return ReportItem.info(report_codes.BOOTH_FETCHING_CONFIG_FROM_NODE,
                           info={
                               "node": node,
                               "config": config,
                           })
Пример #38
0
 def report_item_generator(i):
     if i == 1:
         raise NodeConnectionException("node", "command", "reason")
     elif i == 2:
         raise LibraryError(
             ReportItem.error(
                 report_codes.COMMON_ERROR,
             ),
             ReportItem.info(
                 report_codes.COMMON_INFO,
             )
         )
Пример #39
0
def service_stop_success(service):
    """
    system service was stopped successfully
    string service service name or description
    """
    return ReportItem.info(
        report_codes.SERVICE_STOP_SUCCESS,
        "{service} stopped",
        info={
            "service": service,
        }
    )
Пример #40
0
def booth_config_accepted_by_node(node=None, name_list=None):
    """
    Booth config has been saved on specified node.

    node -- name of node
    name_list -- list of names of booth instance
    """
    return ReportItem.info(report_codes.BOOTH_CONFIG_ACCEPTED_BY_NODE,
                           info={
                               "node": node,
                               "name_list": name_list
                           })
Пример #41
0
def service_stop_started(service):
    """
    system service is being stopped
    string service service name or description
    """
    return ReportItem.info(
        report_codes.SERVICE_STOP_STARTED,
        "Stopping {service}...",
        info={
            "service": service,
        }
    )
Пример #42
0
def service_disable_started(service):
    """
    system service is being disabled
    string service service name or description
    """
    return ReportItem.info(
        report_codes.SERVICE_DISABLE_STARTED,
        "Disabling {service}...",
        info={
            "service": service,
        }
    )
Пример #43
0
def service_disable_started(service, instance=None):
    """
    system service is being disabled
    string service service name or description
    string instance instance of service
    """
    return ReportItem.info(
        report_codes.SERVICE_DISABLE_STARTED,
        info={
            "service": service,
            "instance": instance,
        }
    )
Пример #44
0
def service_disable_success(service, node=None, instance=None):
    """
    system service was disabled successfully
    string service service name or description
    string node node on which service was disabled
    string instance instance of service
    """
    return ReportItem.info(report_codes.SERVICE_DISABLE_SUCCESS,
                           info={
                               "service": service,
                               "node": node,
                               "instance": instance,
                           })
Пример #45
0
def service_start_success(service, node=None, instance=None):
    """
    system service was started successfully
    string service service name or description
    string node node on which service has been requested to start
    string instance instance of service
    """
    return ReportItem.info(report_codes.SERVICE_START_SUCCESS,
                           info={
                               "service": service,
                               "node": node,
                               "instance": instance,
                           })
Пример #46
0
def service_enable_skipped(service, reason, node=None, instance=None):
    """
    enabling system service was skipped, no error occured
    string service service name or description
    string reason why the enabling has been skipped
    string node node on which service has been requested to enable
    string instance instance of service
    """
    return ReportItem.info(report_codes.SERVICE_ENABLE_SKIPPED,
                           info={
                               "service": service,
                               "reason": reason,
                               "node": node,
                               "instance": instance
                           })
Пример #47
0
def agent_name_guessed(entered_name, guessed_name):
    """
    Resource agent name was deduced from the entered name.
    Pcs supports the using of abbreviated resource agent name (e.g.
    ocf:heartbeat:Delay => Delay) when it can be clearly deduced.

    string entered_name is entered name
    string guessed_name is deduced name
    """
    return ReportItem.info(
        report_codes.AGENT_NAME_GUESSED,
        info={
            "entered_name": entered_name,
            "guessed_name": guessed_name,
        }
    )
Пример #48
0
def booth_config_distribution_started():
    """
    booth configuration is about to be sent to nodes
    """
    return ReportItem.info(report_codes.BOOTH_CONFIG_DISTRIBUTION_STARTED, )