예제 #1
0
파일: qdevice.py 프로젝트: wuyeliang/pcs
def _service_enable(lib_env, func):
    try:
        func(lib_env.cmd_runner())
    except external.EnableServiceError as e:
        raise LibraryError(reports.service_enable_error(e.service, e.message))
    lib_env.report_processor.process(
        reports.service_enable_success("quorum device"))
예제 #2
0
def remote_client_enable(reporter, node_communicator, node):
    """
    enable qdevice client service (corosync-qdevice) on a remote node
    """
    response = node_communicator.call_node(node, "remote/qdevice_client_enable", None)
    if response == "corosync is not enabled, skipping":
        reporter.process(reports.service_enable_skipped("corosync-qdevice", "corosync is not enabled", node.label))
    else:
        reporter.process(reports.service_enable_success("corosync-qdevice", node.label))
예제 #3
0
def _service_enable(lib_env, func):
    try:
        func(lib_env.cmd_runner())
    except external.EnableServiceError as e:
        raise LibraryError(
            reports.service_enable_error(e.service, e.message)
        )
    lib_env.report_processor.process(
        reports.service_enable_success("quorum device")
    )
예제 #4
0
파일: qdevice.py 프로젝트: miz-take/pcs
 def _process_response(self, response):
     report = self._get_response_report(response)
     node_label = response.request.target.label
     if report is None:
         if response.data == "corosync is not enabled, skipping":
             report = reports.service_enable_skipped(
                 "corosync-qdevice", "corosync is not enabled", node_label)
         else:
             report = reports.service_enable_success(
                 "corosync-qdevice", node_label)
     self._report(report)
예제 #5
0
파일: sbd.py 프로젝트: dchirikov/pcs
def enable_sbd_service_on_node(report_processor, node_communicator, node):
    """
    Enable SBD service on 'node'.
    Returns list of ReportItem if there was any failure. Empty list otherwise.

    report_processor --
    node_communicator -- NodeCommunicator
    node -- NodeAddresses
    """
    enable_sbd_service(node_communicator, node)
    report_processor.process(reports.service_enable_success("sbd", node.label))
예제 #6
0
def enable_sbd_service_on_node(report_processor, node_communicator, node):
    """
    Enable SBD service on 'node'.
    Returns list of ReportItem if there was any failure. Empty list otherwise.

    report_processor --
    node_communicator -- NodeCommunicator
    node -- NodeAddresses
    """
    enable_sbd_service(node_communicator, node)
    report_processor.process(reports.service_enable_success("sbd", node.label))
예제 #7
0
def remote_client_enable(reporter, node_communicator, node):
    """
    enable qdevice client service (corosync-qdevice) on a remote node
    """
    response = node_communicator.call_node(node,
                                           "remote/qdevice_client_enable",
                                           None)
    if response == "corosync is not enabled, skipping":
        reporter.process(
            reports.service_enable_skipped("corosync-qdevice",
                                           "corosync is not enabled",
                                           node.label))
    else:
        reporter.process(
            reports.service_enable_success("corosync-qdevice", node.label))
예제 #8
0
def enable_booth(env, name=None):
    """
    Enable 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.enable_service(env.cmd_runner(), "booth", name)
    except external.EnableServiceError as e:
        raise LibraryError(
            reports.service_enable_error("booth", e.message, instance=name))
    env.report_processor.process(
        reports.service_enable_success("booth", instance=name))
예제 #9
0
파일: booth.py 프로젝트: tomjelinek/pcs
def enable_booth(env):
    """
    Enable specified instance of booth service. Currently it is supported only
    systemd systems.

    env -- LibraryEnvironment
    """
    external.ensure_is_systemd()
    name = env.booth.name
    try:
        external.enable_service(env.cmd_runner(), "booth", name)
    except external.EnableServiceError as e:
        raise LibraryError(reports.service_enable_error(
            "booth", e.message, instance=name
        ))
    env.report_processor.process(reports.service_enable_success(
        "booth", instance=name
    ))
예제 #10
0
def enable_booth(env, instance_name=None):
    """
    Enable 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.enable_service(env.cmd_runner(), "booth", instance_name)
    except external.EnableServiceError as e:
        raise LibraryError(
            reports.service_enable_error("booth",
                                         e.message,
                                         instance=instance_name))
    env.report_processor.process(
        reports.service_enable_success("booth", instance=instance_name))
예제 #11
0
파일: sbd.py 프로젝트: miz-take/pcs
 def _get_success_report(self, node_label):
     return reports.service_enable_success("sbd", node_label)
예제 #12
0
파일: sbd.py 프로젝트: tomjelinek/pcs
 def _get_success_report(self, node_label):
     return reports.service_enable_success("sbd", node_label)