コード例 #1
0
ファイル: qdevice.py プロジェクト: wuyeliang/pcs
def _service_start(lib_env, func):
    lib_env.report_processor.process(
        reports.service_start_started("quorum device"))
    try:
        func(lib_env.cmd_runner())
    except external.StartServiceError as e:
        raise LibraryError(reports.service_start_error(e.service, e.message))
    lib_env.report_processor.process(
        reports.service_start_success("quorum device"))
コード例 #2
0
ファイル: qdevice_client.py プロジェクト: idevat/pcs
def remote_client_start(reporter, node_communicator, node):
    """
    start qdevice client service (corosync-qdevice) on a remote node
    """
    response = node_communicator.call_node(node, "remote/qdevice_client_start", None)
    if response == "corosync is not running, skipping":
        reporter.process(reports.service_start_skipped("corosync-qdevice", "corosync is not running", node.label))
    else:
        reporter.process(reports.service_start_success("corosync-qdevice", node.label))
コード例 #3
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 running, skipping":
             report = reports.service_start_skipped(
                 "corosync-qdevice", "corosync is not running", node_label)
         else:
             report = reports.service_start_success("corosync-qdevice",
                                                    node_label)
     self._report(report)
コード例 #4
0
ファイル: qdevice.py プロジェクト: HideoYamauchi/pcs
def _service_start(lib_env, func):
    lib_env.report_processor.process(
        reports.service_start_started("quorum device")
    )
    try:
        func(lib_env.cmd_runner())
    except external.StartServiceError as e:
        raise LibraryError(
            reports.service_start_error(e.service, e.message)
        )
    lib_env.report_processor.process(
        reports.service_start_success("quorum device")
    )
コード例 #5
0
ファイル: qdevice_client.py プロジェクト: rriifftt/pcs
def remote_client_start(reporter, node_communicator, node):
    """
    start qdevice client service (corosync-qdevice) on a remote node
    """
    response = node_communicator.call_node(node, "remote/qdevice_client_start",
                                           None)
    if response == "corosync is not running, skipping":
        reporter.process(
            reports.service_start_skipped("corosync-qdevice",
                                          "corosync is not running",
                                          node.label))
    else:
        reporter.process(
            reports.service_start_success("corosync-qdevice", node.label))
コード例 #6
0
def start_booth(env, name=None):
    """
    Start specified instance of booth service. Currently it is supported only
    systemd systems. On non systems it can be run like this:
        BOOTH_CONF_FILE=<booth-file-path> /etc/initd/booth-arbitrator

    env -- LibraryEnvironment
    name -- string, name of booth instance
    """
    external.ensure_is_systemd()
    try:
        external.start_service(env.cmd_runner(), "booth", name)
    except external.StartServiceError as e:
        raise LibraryError(
            reports.service_start_error("booth", e.message, instance=name))
    env.report_processor.process(
        reports.service_start_success("booth", instance=name))
コード例 #7
0
ファイル: booth.py プロジェクト: tomjelinek/pcs
def start_booth(env):
    """
    Start specified instance of booth service. Currently it is supported only
    systemd systems. On non systems it can be run like this:
        BOOTH_CONF_FILE=<booth-file-path> /etc/initd/booth-arbitrator

    env -- LibraryEnvironment
    """
    external.ensure_is_systemd()
    name = env.booth.name
    try:
        external.start_service(env.cmd_runner(), "booth", name)
    except external.StartServiceError as e:
        raise LibraryError(reports.service_start_error(
            "booth", e.message, instance=name
        ))
    env.report_processor.process(reports.service_start_success(
        "booth", instance=name
    ))
コード例 #8
0
def start_booth(env, instance_name=None):
    """
    Start specified instance of booth service, systemd systems supported only.
        On non-systemd systems it can be run like this:
        BOOTH_CONF_FILE=<booth-file-path> /etc/initd/booth-arbitrator

    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.start_service(env.cmd_runner(), "booth", instance_name)
    except external.StartServiceError as e:
        raise LibraryError(
            reports.service_start_error("booth",
                                        e.message,
                                        instance=instance_name))
    env.report_processor.process(
        reports.service_start_success("booth", instance=instance_name))