Bug 2123727
| Summary: | XML output of `crm_resource --validate` doesn't conform to XML schema | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 9 | Reporter: | Ondrej Mular <omular> |
| Component: | pacemaker | Assignee: | Reid Wahl <nwahl> |
| Status: | CLOSED ERRATA | QA Contact: | cluster-qe <cluster-qe> |
| Severity: | low | Docs Contact: | |
| Priority: | high | ||
| Version: | 9.1 | CC: | cluster-maint, jrehova, kgaillot, msmazova, nwahl |
| Target Milestone: | rc | Keywords: | Triaged |
| Target Release: | --- | Flags: | pm-rhel:
mirror+
|
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | pacemaker-2.1.5-1.el9 | Doc Type: | Bug Fix |
| Doc Text: |
Cause: XML schemas for validating command output were written in such a way that never allowed for commands that produce an error to be validated.
Consequence: XML output produced by `crm_resource --validate` commands that produce an error don't conform to the pacemaker API XML schema.
Fix: XML schemas for command output were rearranged to match the expected output.
Result: Output conforms to the pacemaker API XML schema.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2023-05-09 07:18:17 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 2112270, 2112271 | ||
Resolved by upstream commit 16cbddef Version of pacemaker: > [root@virt-533 ~]# rpm -q pacemaker > pacemaker-2.1.5-2.el9.x86_64 Result: Output conform to the pacemaker API XML schema > [root@virt-533 ~]# /usr/sbin/crm_resource --output-as xml --validate --class ocf --agent IPaddr2 --provider heartbeat | xmllint --relaxng /usr/share/pacemaker/api/api-result.rng - > <?xml version="1.0"?> > <pacemaker-result api-version="2.25" request="/usr/sbin/crm_resource --output-as xml --validate --class ocf --agent IPaddr2 --provider heartbeat"> > <resource-agent-action action="validate" class="ocf" type="IPaddr2" provider="heartbeat"> > <overrides/> > <agent-status code="6" message="not configured" execution_code="0" execution_message="complete" reason="IP address (the ip parameter) is mandatory"/> > <command code="6"> > <output source="stderr">ocf-exit-reason:IP address (the ip parameter) is mandatory > </output> > </command> > </resource-agent-action> > <status code="6" message="Not configured"> > <errors> > <error>crm_resource: Error performing operation: Not configured</error> > </errors> > </status> > </pacemaker-result> > - validates > [root@virt-533 ~]# echo $? > 0 > [root@virt-533 ~]# /usr/sbin/crm_resource --output-as xml --validate --class ocf --agent apache --provider heartbeat | xmllint --relaxng /usr/share/pacemaker/api/api-result.rng - > <?xml version="1.0"?> > <pacemaker-result api-version="2.25" request="/usr/sbin/crm_resource --output-as xml --validate --class ocf --agent apache --provider heartbeat"> > <resource-agent-action action="validate" class="ocf" type="apache" provider="heartbeat"> > <overrides/> > <agent-status code="5" message="not installed" execution_code="0" execution_message="complete" reason="environment is invalid, resource considered stopped"/> > <command code="5"> > <output source="stderr">ocf-exit-reason:apache httpd program not found > ocf-exit-reason:environment is invalid, resource considered stopped > </output> > </command> > </resource-agent-action> > <status code="5" message="Not installed"> > <errors> > <error>crm_resource: Error performing operation: Not installed</error> > </errors> > </status> > </pacemaker-result> > - validates > [root@virt-533 ~]# echo $? > 0 > [root@virt-533 ~]# /usr/sbin/crm_resource --output-as xml --validate --class ocf --agent Dummy --provider pacemaker | xmllint --relaxng /usr/share/pacemaker/api/api-result.rng - > <?xml version="1.0"?> > <pacemaker-result api-version="2.25" request="/usr/sbin/crm_resource --output-as xml --validate --class ocf --agent Dummy --provider pacemaker"> > <resource-agent-action action="validate" class="ocf" type="Dummy" provider="pacemaker"> > <overrides/> > <agent-status code="0" message="ok" execution_code="0" execution_message="complete"/> > </resource-agent-action> > <status code="0" message="OK"/> > </pacemaker-result> > - validates > [root@virt-533 ~]# echo $? > 0 Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (pacemaker bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2023:2150 |
Description of problem: XML output produced by `crm_resource --validate` commands doesn't conform to pacemaker API XML schema. Version-Release number of selected component (if applicable): [root@rhel91-devel1 ~]# rpm -qa pacemaker pacemaker-2.1.4-5.el9.x86_64 How reproducible: always Steps to Reproduce: [root@rhel91-devel1 ~]# /usr/sbin/crm_resource --output-as xml --validate --class ocf --agent IPaddr2 --provider heartbeat | xmllint --relaxng /usr/share/pacemaker/api/api-result.rng - <?xml version="1.0"?> <pacemaker-result api-version="2.22" request="/usr/sbin/crm_resource --output-as xml --validate --class ocf --agent IPaddr2 --provider heartbeat"> <resource-agent-action action="validate" class="ocf" type="IPaddr2" provider="heartbeat"> <overrides/> <agent-status code="6" message="not configured" execution_code="0" execution_message="complete" reason="IP address (the ip parameter) is mandatory"/> <command code="6"> <output source="stderr">ocf-exit-reason:IP address (the ip parameter) is mandatory </output> </command> </resource-agent-action> <status code="6" message="Not configured"> <errors> <error>crm_resource: Error performing operation: Not configured</error> </errors> </status> </pacemaker-result> -:1: element pacemaker-result: Relax-NG validity error : Expecting element status, got resource-agent-action -:1: element pacemaker-result: Relax-NG validity error : Element pacemaker-result failed to validate content - fails to validate [root@rhel91-devel1 ~]# echo $? 3 Actual results: Produced XML doesn't conform to the XML schema Expected results: Output conform to the pacemaker API XML schema