示例#1
0
def get_cib_xml(runner, scope=None):
    stdout, stderr, retval = get_cib_xml_cmd_results(runner, scope)
    if retval != 0:
        if retval == __EXITCODE_CIB_SCOPE_VALID_BUT_NOT_PRESENT and scope:
            raise LibraryError(
                reports.cib_load_error_scope_missing(
                    scope, join_multilines([stderr, stdout])))
        raise LibraryError(
            reports.cib_load_error(join_multilines([stderr, stdout])))
    return stdout
示例#2
0
def get_cib_xml(runner, scope=None):
    command = [__exec("cibadmin"), "--local", "--query"]
    if scope:
        command.append("--scope={0}".format(scope))
    output, retval = runner.run(command)
    if retval != 0:
        if retval == __EXITCODE_CIB_SCOPE_VALID_BUT_NOT_PRESENT and scope:
            raise LibraryError(
                reports.cib_load_error_scope_missing(scope, retval, output)
            )
        else:
            raise LibraryError(reports.cib_load_error(retval, output))
    return output
示例#3
0
文件: live.py 项目: bgistone/pcs
def get_cib_xml(runner, scope=None):
    command = [__exec("cibadmin"), "--local", "--query"]
    if scope:
        command.append("--scope={0}".format(scope))
    stdout, stderr, retval = runner.run(command)
    if retval != 0:
        if retval == __EXITCODE_CIB_SCOPE_VALID_BUT_NOT_PRESENT and scope:
            raise LibraryError(
                reports.cib_load_error_scope_missing(
                    scope, join_multilines([stderr, stdout])))
        else:
            raise LibraryError(
                reports.cib_load_error(join_multilines([stderr, stdout])))
    return stdout
示例#4
0
文件: live.py 项目: tomjelinek/pcs
def get_cib_xml(runner, scope=None):
    stdout, stderr, retval = get_cib_xml_cmd_results(runner, scope)
    if retval != 0:
        if retval == __EXITCODE_CIB_SCOPE_VALID_BUT_NOT_PRESENT and scope:
            raise LibraryError(
                reports.cib_load_error_scope_missing(
                    scope,
                    join_multilines([stderr, stdout])
                )
            )
        raise LibraryError(
            reports.cib_load_error(join_multilines([stderr, stdout]))
        )
    return stdout