Hide Forgot
Description of problem: When disallowed role of resource operation is entered in the "pcs resource create" command, pcs suggests to use flag --force. But the command with flag --force produces invalid cib. Steps to Reproduce: [vm-rhel72-1 ~] $ pcs resource create R ocf:heartbeat:Dummy op monitor role=abc Error: role must be: Stopped, Started, Slave or Master (use --force to override) [vm-rhel72-1 ~] $ pcs resource create R ocf:heartbeat:Dummy op monitor role=abc --force Actual results: [vm-rhel72-1 ~] $ pcs resource create R ocf:heartbeat:Dummy op monitor role=abc Error: role must be: Stopped, Started, Slave or Master (use --force to override) [vm-rhel72-1 ~] $ pcs resource create R ocf:heartbeat:Dummy op monitor role=abc --force Error: Unable to update cib Call cib_replace failed (-203): Update does not conform to the configured schema <cib Expected results: [vm-rhel72-1 ~] $ pcs resource create R ocf:heartbeat:Dummy op monitor role=abc Error: role must be: Stopped, Started, Slave or Master [vm-rhel72-1 ~] $ pcs resource create R ocf:heartbeat:Dummy op monitor role=abc --force Error: role must be: Stopped, Started, Slave or Master
Note that there are more op-attributes that suffers with a similar problem: > requires (should be one of: nothing quorum fencing unfencing) [vm-rhel72-1 ~] $ pcs resource create R ocf:heartbeat:Dummy op monitor requires=abc Error: Unable to update cib Call cib_replace failed (-203): Update does not conform to the configured schema <cib.... > on-fail (should be one of: ignore block stop restart standby fence) [vm-rhel72-1 ~] $ pcs resource create R ocf:heartbeat:Dummy op monitor on-fail=abc Error: Unable to update cib Call cib_replace failed (-203): Update does not conform to the configured schema <cib... > record-pending (should be boolean true or false) [vm-rhel72-1 ~] $ pcs resource create R ocf:heartbeat:Dummy op monitor record-pending=abc Error: Unable to update cib Call cib_replace failed (-203): Update does not conform to the configured schema <cib... > enabled (should be boolean true or false) [vm-rhel72-1 ~] $ pcs resource create R ocf:heartbeat:Dummy op monitor enabled=abc Error: Unable to update cib Call cib_replace failed (-203): Update does not conform to the configured schema <cib
> start-delay and interval-origin can not appear together [vm-rhel72-1 ~] $ pcs resource create R ocf:heartbeat:Dummy op monitor start-delay=10 interval-origin=20 Error: Unable to update cib Call cib_replace failed (-203): Update does not conform to the configured schema <cib...
Created attachment 1246588 [details] proposed fix Tests are in the patch.
After Fix: [vm-rhel72-1 ~] $ rpm -q pcs pcs-0.9.156-1.el7.x86_64 [vm-rhel72-1 ~] $ pcs resource create R ocf:heartbeat:Dummy op monitor role=abc Error: 'abc' is not a valid role value, use Master, Slave, Started, Stopped [vm-rhel72-1 ~] $ pcs resource create R ocf:heartbeat:Dummy op monitor role=abc --force Error: 'abc' is not a valid role value, use Master, Slave, Started, Stopped [vm-rhel72-1 ~] $ pcs resource create R ocf:heartbeat:Dummy op monitor requires=abc Error: 'abc' is not a valid requires value, use fencing, nothing, quorum, unfencing [vm-rhel72-1 ~] $ pcs resource create R ocf:heartbeat:Dummy op monitor requires=abc --force Error: 'abc' is not a valid requires value, use fencing, nothing, quorum, unfencing [vm-rhel72-1 ~] $ pcs resource create R ocf:heartbeat:Dummy op monitor on-fail=abc Error: 'abc' is not a valid on-fail value, use block, fence, ignore, restart, restart-container, standby, stop [vm-rhel72-1 ~] $ pcs resource create R ocf:heartbeat:Dummy op monitor on-fail=abc --force Error: 'abc' is not a valid on-fail value, use block, fence, ignore, restart, restart-container, standby, stop [vm-rhel72-1 ~] $ pcs resource create R ocf:heartbeat:Dummy op monitor record-pending=abc Error: 'abc' is not a valid record-pending value, use 0, 1, false, true [vm-rhel72-1 ~] $ pcs resource create R ocf:heartbeat:Dummy op monitor record-pending=abc --force Error: 'abc' is not a valid record-pending value, use 0, 1, false, true [vm-rhel72-1 ~] $ pcs resource create R ocf:heartbeat:Dummy op monitor enabled=abc Error: 'abc' is not a valid enabled value, use 0, 1, false, true [vm-rhel72-1 ~] $ pcs resource create R ocf:heartbeat:Dummy op monitor enabled=abc --force Error: 'abc' is not a valid enabled value, use 0, 1, false, true
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, 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-2017:1958