Page MenuHomeClusterLabs Projects

cts-fencing is broken due to bug in validate.py:rng_directory()
Closed (Merged)Public

Assigned To
Authored By
nrwahl2
Sun, Mar 30, 5:11 PM
Tags
Referenced Files
None
Subscribers

Description

Step 1 FAILED - xmllint failed: '<?xml version="1.0"?>\n<pacemaker-result api-version="2.38" request="stonith_admin --output-as=xml -R false1 -a fence_dummy -o mode=fail -o \'pcmk_host_list=node1 node2 node3\'">\n  <status code="0" message="OK"/>\n</pacemaker-result>\nI/O warning : failed to load "/home/reid/git/pacemaker/cts/xml/api/api-result.rng": No such file or directory\nRelax-NG parser error : xmlRelaxNGParse: could not load /home/reid/git/pacemaker/cts/xml/api/api-result.rng\nRelax-NG schema /home/reid/git/pacemaker/cts/xml/api/api-result.rng failed to compile\n'
... many more ...

There is no cts/xml directory. This might be as simple as the following (note commented line and replacement below it), unless there's some other consideration or some reason why there should be a cts/xml directory. This does fix the issue for me.

def rng_directory():
    """Return the directory containing RNG schema files."""
    if os.environ.get("PCMK_schema_directory", "") != "":
        return os.environ["PCMK_schema_directory"]

    for path in sys.path:
        if os.path.exists(f"{path}/cts-fencing.in"):
            #return f"{path}/xml"
            return f"{path}/../xml"

    return BuildOptions.SCHEMA_DIR

Event Timeline

nrwahl2 triaged this task as Normal priority.Sun, Mar 30, 5:11 PM
nrwahl2 created this task.
nrwahl2 created this object with edit policy "Restricted Project (Project)".
nrwahl2 updated the task description. (Show Details)
clumens changed the task status from Open to WIP.Mon, Mar 31, 12:26 PM
clumens claimed this task.

That should work - the whole point of that block is basically to check if we're running from a source checkout and if so, set the right schema directory. I bet running this from a source directory where you don't also have PCMK_schema_directory set is something that doesn't happen all that often.

In T982#15872, @clumens wrote:

I bet running this from a source directory where you don't also have PCMK_schema_directory set is something that doesn't happen all that often.

Maybe for other people. That's literally the only way I run cts.