Bug 2049720

Summary: Resource ocf:pacemaker:attribute does not comply with the OCF 1.1 standard
Product: Red Hat Enterprise Linux 9 Reporter: Markéta Smazová <msmazova>
Component: pacemakerAssignee: Chris Lumens <clumens>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: low Docs Contact:
Priority: medium    
Version: 9.0CC: cluster-maint, kgaillot, sbradley, tojeline
Target Milestone: rcKeywords: Triaged
Target Release: 9.1   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: pacemaker-2.1.3-1.el9 Doc Type: No Doc Update
Doc Text:
This is mostly invisible to end users
Story Points: ---
Clone Of:
: 2049722 (view as bug list) Environment:
Last Closed: 2022-11-15 09:49:38 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:

Description Markéta Smazová 2022-02-02 15:31:57 UTC
Description of problem:
Resource ocf:pacemaker:attribute does not comply with the OCF 1.1 standard

Version-Release number of selected component (if applicable):
pacemaker-cli-2.1.2-4.el9.x86_64

How reproducible:
always, easily

Steps to Reproduce:
1.
# curl -s https://raw.githubusercontent.com/ClusterLabs/OCF-spec/main/ra/1.1/ra-api.rng -o ocf1.1.rng

2.
# crm_resource --show-metadata=ocf:pacemaker:attribute | xmllint --noout --relaxng ocf1.1.rng -
-:5: element longdesc: Relax-NG validity error : Did not expect element longdesc there
-:5: element longdesc: Relax-NG validity error : Element resource-agent has extra content: longdesc
- fails to validate

Actual results:
Resource metadata fails to validate with the rng scheme of the ocf 1.1 standard.

Expected results:
Resource metadata validate with the rng scheme of the ocf 1.1 standard.

Comment 1 Ken Gaillot 2022-02-02 15:48:39 UTC
Interesting -- this is a quirk of the schema I wasn't aware of. The schema only allows longdesc followed by shortdesc (not the other way around). The standard never explicitly specifies that, and I doubt it's intentional. But the schema is technically part of the standard, so I'll make sure all the pacemaker agents follow that pattern.

I'm already planning what could go into OCF 1.2, so I'll make a note to allow either order ...

Comment 2 Tomas Jelinek 2022-02-02 16:05:35 UTC
Ken: You may take a look at the schema used by pcs. It is a bit relaxed and doesn't care about order of elements. https://github.com/ClusterLabs/pcs/blob/main/data/ocf-1.1.rng

Comment 3 Ken Gaillot 2022-02-02 17:13:28 UTC
(In reply to Tomas Jelinek from comment #2)
> Ken: You may take a look at the schema used by pcs. It is a bit relaxed and
> doesn't care about order of elements.
> https://github.com/ClusterLabs/pcs/blob/main/data/ocf-1.1.rng

Yep, that interleave looks like what we want

Comment 4 Ken Gaillot 2022-02-14 19:46:12 UTC
Fixed upstream as of commit c078566a

Comment 10 Markéta Smazová 2022-06-13 14:54:12 UTC
after fix
----------

[root@virt-527 ~]# rpm -q pacemaker pacemaker-cli
pacemaker-2.1.3-2.el9.x86_64
pacemaker-cli-2.1.3-2.el9.x86_64

[root@virt-527 ~]# curl -s https://raw.githubusercontent.com/ClusterLabs/OCF-spec/main/ra/1.1/ra-api.rng -o ocf1.1.rng

[root@virt-527 ~]# crm_resource --show-metadata=ocf:pacemaker:attribute | xmllint --noout --relaxng ocf1.1.rng -
- validates


verified as SanityOnly in pacemaker-2.1.3-2.el9

Comment 12 errata-xmlrpc 2022-11-15 09:49:38 UTC
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-2022:7937