Exemplo n.º 1
0
def remote_client_stop(reporter, node_communicator, node):
    """
    stop qdevice client service (corosync-qdevice) on a remote node
    """
    node_communicator.call_node(node, "remote/qdevice_client_stop", None)
    reporter.process(
        reports.service_stop_success("corosync-qdevice", node.label))
Exemplo n.º 2
0
def remote_client_stop(reporter, node_communicator, node):
    """
    stop qdevice client service (corosync-qdevice) on a remote node
    """
    node_communicator.call_node(node, "remote/qdevice_client_stop", None)
    reporter.process(
        reports.service_stop_success("corosync-qdevice", node.label)
    )
Exemplo n.º 3
0
def _service_stop(lib_env, func):
    lib_env.report_processor.process(
        reports.service_stop_started("quorum device"))
    try:
        func(lib_env.cmd_runner())
    except external.StopServiceError as e:
        raise LibraryError(reports.service_stop_error(e.service, e.message))
    lib_env.report_processor.process(
        reports.service_stop_success("quorum device"))
Exemplo n.º 4
0
def _service_stop(lib_env, func):
    lib_env.report_processor.process(
        reports.service_stop_started("quorum device")
    )
    try:
        func(lib_env.cmd_runner())
    except external.StopServiceError as e:
        raise LibraryError(
            reports.service_stop_error(e.service, e.message)
        )
    lib_env.report_processor.process(
        reports.service_stop_success("quorum device")
    )
Exemplo n.º 5
0
def stop_booth(env, name=None):
    """
    Stop specified instance of booth service. Currently it is supported only
    systemd systems.

    env -- LibraryEnvironment
    name -- string, name of booth instance
    """
    external.ensure_is_systemd()
    try:
        external.stop_service(env.cmd_runner(), "booth", name)
    except external.StopServiceError as e:
        raise LibraryError(
            reports.service_stop_error("booth", e.message, instance=name))
    env.report_processor.process(
        reports.service_stop_success("booth", instance=name))
Exemplo n.º 6
0
def stop_booth(env):
    """
    Stop specified instance of booth service. Currently it is supported only
    systemd systems.

    env -- LibraryEnvironment
    """
    external.ensure_is_systemd()
    name = env.booth.name
    try:
        external.stop_service(env.cmd_runner(), "booth", name)
    except external.StopServiceError as e:
        raise LibraryError(reports.service_stop_error(
            "booth", e.message, instance=name
        ))
    env.report_processor.process(reports.service_stop_success(
        "booth", instance=name
    ))
Exemplo n.º 7
0
def stop_booth(env, instance_name=None):
    """
    Stop specified instance of booth service, systemd systems supported only.

    LibraryEnvironment env
    string instance_name -- booth instance name
    """
    external.ensure_is_systemd()
    booth_env = env.get_booth_env(instance_name)
    _ensure_live_env(env, booth_env)
    instance_name = booth_env.instance_name

    try:
        external.stop_service(env.cmd_runner(), "booth", instance_name)
    except external.StopServiceError as e:
        raise LibraryError(
            reports.service_stop_error("booth",
                                       e.message,
                                       instance=instance_name))
    env.report_processor.process(
        reports.service_stop_success("booth", instance=instance_name))
Exemplo n.º 8
0
 def _get_success_report(self, node_label):
     return reports.service_stop_success("corosync-qdevice", node_label)