Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 3
0
Arquivo: live.py Projeto: 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
Exemplo n.º 4
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