Example #1
0
def _service_disable(lib_env, func):
    try:
        func(lib_env.cmd_runner())
    except external.DisableServiceError as e:
        raise LibraryError(reports.service_disable_error(e.service, e.message))
    lib_env.report_processor.process(
        reports.service_disable_success("quorum device"))
Example #2
0
def _service_disable(lib_env, func):
    try:
        func(lib_env.cmd_runner())
    except external.DisableServiceError as e:
        raise LibraryError(
            reports.service_disable_error(e.service, e.message)
        )
    lib_env.report_processor.process(
        reports.service_disable_success("quorum device")
    )
Example #3
0
def disable_booth(env, name=None):
    """
    Disable 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.disable_service(env.cmd_runner(), "booth", name)
    except external.DisableServiceError as e:
        raise LibraryError(
            reports.service_disable_error("booth", e.message, instance=name))
    env.report_processor.process(
        reports.service_disable_success("booth", instance=name))
Example #4
0
def disable_booth(env):
    """
    Disable specified instance of booth service. Currently it is supported only
    systemd systems.

    env -- LibraryEnvironment
    """
    external.ensure_is_systemd()
    name = env.booth.name
    try:
        external.disable_service(env.cmd_runner(), "booth", name)
    except external.DisableServiceError as e:
        raise LibraryError(reports.service_disable_error(
            "booth", e.message, instance=name
        ))
    env.report_processor.process(reports.service_disable_success(
        "booth", instance=name
    ))
Example #5
0
def disable_booth(env, instance_name=None):
    """
    Disable 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.disable_service(env.cmd_runner(), "booth", instance_name)
    except external.DisableServiceError as e:
        raise LibraryError(
            reports.service_disable_error("booth",
                                          e.message,
                                          instance=instance_name))
    env.report_processor.process(
        reports.service_disable_success("booth", instance=instance_name))