示例#1
0
文件: quorum.py 项目: miz-take/pcs
def set_expected_votes_live(lib_env, expected_votes):
    """
    set expected votes in live cluster to specified value
    numeric expected_votes desired value of expected votes
    """
    if lib_env.is_cman_cluster:
        raise LibraryError(reports.cman_unsupported_command())

    try:
        votes_int = int(expected_votes)
        if votes_int < 1:
            raise ValueError()
    except ValueError:
        raise LibraryError(
            reports.invalid_option_value("expected votes", expected_votes,
                                         "positive integer"))

    corosync_live.set_expected_votes(lib_env.cmd_runner(), votes_int)
示例#2
0
def set_expected_votes_live(lib_env, expected_votes):
    """
    set expected votes in live cluster to specified value
    numeric expected_votes desired value of expected votes
    """
    if lib_env.is_cman_cluster:
        raise LibraryError(reports.cman_unsupported_command())

    try:
        votes_int = int(expected_votes)
        if votes_int < 1:
            raise ValueError()
    except ValueError:
        raise LibraryError(reports.invalid_option_value(
            "expected votes",
            expected_votes,
            "positive integer"
        ))

    corosync_live.set_expected_votes(lib_env.cmd_runner(), votes_int)
示例#3
0
文件: quorum.py 项目: miz-take/pcs
def __ensure_not_cman(lib_env):
    if lib_env.is_corosync_conf_live and lib_env.is_cman_cluster:
        raise LibraryError(reports.cman_unsupported_command())
示例#4
0
def _ensure_not_cman(lib_env):
    if lib_env.is_cman_cluster:
        raise LibraryError(reports.cman_unsupported_command())