RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2151164 - 'pcs resource config' fails to print boolean attributes set to false
Summary: 'pcs resource config' fails to print boolean attributes set to false
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: pcs
Version: 9.1
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: 9.2
Assignee: Ondrej Mular
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks: 2151166 2151575
TreeView+ depends on / blocked
 
Reported: 2022-12-06 09:08 UTC by Tomas Jelinek
Modified: 2023-05-09 07:39 UTC (History)
10 users (show)

Fixed In Version: pcs-0.11.4-2.el9
Doc Type: Bug Fix
Doc Text:
Cause: Values of bool and int type are handled incorrectly in `pcs resource|stonith config` command Consequence: Options with values `0` and `false` are not displayed at all as if they were not set. Fix: Correctly handle bool and int values. Result: All set options are correctly displayed.
Clone Of:
: 2151166 2151575 (view as bug list)
Environment:
Last Closed: 2023-05-09 07:18:34 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github ClusterLabs pcs issues 604 0 None open [Question] How to confirm monitor stop. 2022-12-06 09:08:38 UTC
Red Hat Issue Tracker CLUSTERQE-6282 0 None None None 2022-12-06 10:07:49 UTC
Red Hat Issue Tracker RHELPLAN-141398 0 None None None 2022-12-06 09:10:32 UTC
Red Hat Product Errata RHBA-2023:2151 0 None None None 2023-05-09 07:18:55 UTC

Description Tomas Jelinek 2022-12-06 09:08:38 UTC
Description of problem:
'pcs resource config' doesn't print boolean attributes if their value is false. This was discovered for resource operation attributes. If '--output-format=json' is used, then the attributes are printed correctly.

We need to check other parts of 'pcs resource config' as well as 'pcs cluster config' command to make sure they are free of this bug.


Version-Release number of selected component (if applicable):
pcs-0.11.3-4.el9


How reproducible:
always, easily


Steps to Reproduce:
1. pcs resource create test ocf:pacemaker:Dummy
2. pcs resource update test op monitor interval=10s timeout=20s enabled=false
3. pcs resource config test


Actual results:
"enabled=false" is missing in the output for the monitor operation


Expected results:
"enabled=false" is present in the output for the monitor operation


Additional info:
reported upstream: https://github.com/ClusterLabs/pcs/issues/604

Comment 5 Ondrej Mular 2022-12-12 10:00:52 UTC
Upstream patch:
https://github.com/ClusterLabs/pcs/commit/6cd773443d48be1f3ad9f557033705f1a0656e6f

Test:
[root@rhel91-node1 pcs]# pcs resource create dummy ocf:pacemaker:Dummy op monitor enabled=false
[root@rhel91-node1 pcs]# pcs resource config dummy
Resource: dummy (class=ocf provider=pacemaker type=Dummy)
  Operations:
    migrate_from: dummy-migrate_from-interval-0s
      interval=0s
      timeout=20s
    migrate_to: dummy-migrate_to-interval-0s
      interval=0s
      timeout=20s
    monitor: dummy-monitor-interval-60s
      interval=60s
      enabled=0
    reload: dummy-reload-interval-0s
      interval=0s
      timeout=20s
    reload-agent: dummy-reload-agent-interval-0s
      interval=0s
      timeout=20s
    start: dummy-start-interval-0s
      interval=0s
      timeout=20s
    stop: dummy-stop-interval-0s
      interval=0s
      timeout=20s

Comment 6 Michal Pospisil 2022-12-15 14:14:23 UTC
DevTestResults:

[root@r09-02-a ~]# rpm -q pcs
pcs-0.11.4-2.el9.x86_64

[root@r09-02-a ~]# pcs resource create dummy1 ocf:pacemaker:Dummy op monitor enabled=false  

[root@r09-02-a pcs]# pcs resource config dummy1
Resource: dummy1 (class=ocf provider=pacemaker type=Dummy)
 Operations:
   migrate_from: dummy1-migrate_from-interval-0s
     interval=0s
     timeout=20s
   migrate_to: dummy1-migrate_to-interval-0s
     interval=0s
     timeout=20s
   monitor: dummy1-monitor-interval-60s
     interval=60s
     enabled=0
   reload: dummy1-reload-interval-0s
     interval=0s
     timeout=20s
   reload-agent: dummy1-reload-agent-interval-0s
     interval=0s
     timeout=20s
   start: dummy1-start-interval-0s
     interval=0s
     timeout=20s
   stop: dummy1-stop-interval-0s
     interval=0s
     timeout=20s

Comment 10 svalasti 2023-01-17 14:37:26 UTC
### BEFORE

[root@virt-264 ~]# rpm -q pcs
pcs-0.11.4-1.el9.x86_64

[root@virt-264 ~]# pcs resource create d1 ocf:pacemaker:Dummy

[root@virt-264 ~]# pcs resource update d1 op monitor enabled=false meta is_managed=false

[root@virt-264 ~]# pcs resource config --output-format text d1
Resource: d1 (class=ocf provider=pacemaker type=Dummy)
  Meta Attributes: d1-meta_attributes
    is_managed=false
  Operations:
    migrate_from: d1-migrate_from-interval-0s
      interval=0s
      timeout=20s
    migrate_to: d1-migrate_to-interval-0s
      interval=0s
      timeout=20s
    monitor: d1-monitor-interval-60s
      interval=60s
    reload: d1-reload-interval-0s
      interval=0s
      timeout=20s
    reload-agent: d1-reload-agent-interval-0s
      interval=0s
      timeout=20s
    start: d1-start-interval-0s
      interval=0s
      timeout=20s
    stop: d1-stop-interval-0s
      interval=0s
      timeout=20s

> Meta attributes with 'false' value(s) are displayed correctly, but op attributes with 'false' value(s) are not displayed at all. 


[root@virt-264 ~]# pcs resource config --output-format cmd d1
pcs resource create --no-default-ops --force -- d1 ocf:pacemaker:Dummy \
  op \
    migrate_from interval=0s id=d1-migrate_from-interval-0s timeout=20s \
    migrate_to interval=0s id=d1-migrate_to-interval-0s timeout=20s \
    monitor interval=60s id=d1-monitor-interval-60s \
    reload interval=0s id=d1-reload-interval-0s timeout=20s \
    reload-agent interval=0s id=d1-reload-agent-interval-0s timeout=20s \
    start interval=0s id=d1-start-interval-0s timeout=20s \
    stop interval=0s id=d1-stop-interval-0s timeout=20s \
  meta is_managed=false

> Same results as for 'text' format above.


### AFTER

[root@virt-264 ~]# rpm -q pcs
pcs-0.11.4-2.el9.x86_64


## 1. Check if 'pcs resource config' is able to display boolean op attributes that are set to 'false'

[root@virt-264 ~]# pcs resource create d1 ocf:pacemaker:Dummy

[root@virt-264 ~]# echo $?
0

[root@virt-264 ~]# pcs resource update d1 op reload interval=10s enabled=false op monitor enabled=false

[root@virt-264 ~]# echo $?
0


## 1.A. 'Text' format ('pcs resource config --output-format text d1' is same as 'pcs resource config d1')

[root@virt-264 ~]# pcs resource config --output-format text d1
Resource: d1 (class=ocf provider=pacemaker type=Dummy)
  Operations:
    migrate_from: d1-migrate_from-interval-0s
      interval=0s
      timeout=20s
    migrate_to: d1-migrate_to-interval-0s
      interval=0s
      timeout=20s
    monitor: d1-monitor-interval-60s
      interval=60s
      enabled=0
    reload: d1-reload-interval-10s
      interval=10s
      enabled=0
    reload-agent: d1-reload-agent-interval-0s
      interval=0s
      timeout=20s
    start: d1-start-interval-0s
      interval=0s
      timeout=20s
    stop: d1-stop-interval-0s
      interval=0s
      timeout=20s

> Ok. 'Text' format displays boolean op attributes that are set to 'false'. ('false' is displayed as '0')


## 1.B. 'CMD' format

[root@virt-264 ~]# pcs resource config --output-format cmd d1
pcs resource create --no-default-ops --force -- d1 ocf:pacemaker:Dummy \
  op \
    migrate_from interval=0s id=d1-migrate_from-interval-0s timeout=20s \
    migrate_to interval=0s id=d1-migrate_to-interval-0s timeout=20s \
    monitor interval=60s id=d1-monitor-interval-60s enabled=0 \
    reload interval=10s id=d1-reload-interval-10s enabled=0 \
    reload-agent interval=0s id=d1-reload-agent-interval-0s timeout=20s \
    start interval=0s id=d1-start-interval-0s timeout=20s \
    stop interval=0s id=d1-stop-interval-0s timeout=20s

> Ok. 'CMD' format displays boolean op attributes that are set to 'false'.


## 1.C. 'JSON' format

[root@virt-264 ~]# pcs resource config --output-format json d1 | fmt -w 80
{"primitives": [{"id": "d1", "agent_name": {"standard": "ocf", "provider":
"pacemaker", "type": "Dummy"}, "description": null, "operations": [{"id":
"d1-migrate_from-interval-0s", "name": "migrate_from", "interval":
"0s", "description": null, "start_delay": null, "interval_origin": null,
"timeout": "20s", "enabled": null, "record_pending": null, "role": null,
"on_fail": null, "meta_attributes": [], "instance_attributes": []},
{"id": "d1-migrate_to-interval-0s", "name": "migrate_to", "interval":
"0s", "description": null, "start_delay": null, "interval_origin": null,
"timeout": "20s", "enabled": null, "record_pending": null, "role":
null, "on_fail": null, "meta_attributes": [], "instance_attributes":
[]}, {"id": "d1-monitor-interval-60s", "name": "monitor", "interval":
"60s", "description": null, "start_delay": null, "interval_origin":
null, "timeout": null, "enabled": false, "record_pending": null, "role":
null, "on_fail": null, "meta_attributes": [], "instance_attributes":
[]}, {"id": "d1-reload-interval-10s", "name": "reload", "interval":
"10s", "description": null, "start_delay": null, "interval_origin": null,
"timeout": null, "enabled": false, "record_pending": null, "role": null,
"on_fail": null, "meta_attributes": [], "instance_attributes": []},
{"id": "d1-reload-agent-interval-0s", "name": "reload-agent", "interval":
"0s", "description": null, "start_delay": null, "interval_origin": null,
"timeout": "20s", "enabled": null, "record_pending": null, "role": null,
"on_fail": null, "meta_attributes": [], "instance_attributes": []}, {"id":
"d1-start-interval-0s", "name": "start", "interval": "0s", "description": null,
"start_delay": null, "interval_origin": null, "timeout": "20s", "enabled":
null, "record_pending": null, "role": null, "on_fail": null, "meta_attributes":
[], "instance_attributes": []}, {"id": "d1-stop-interval-0s", "name": "stop",
"interval": "0s", "description": null, "start_delay": null, "interval_origin":
null, "timeout": "20s", "enabled": null, "record_pending": null, "role":
null, "on_fail": null, "meta_attributes": [], "instance_attributes": []}],
"meta_attributes": [], "instance_attributes": [], "utilization": []}],
"clones": [], "groups": [], "bundles": []}

> Ok. 'CMD' format displays boolean op attributes that are set to 'false'. (same as for previous versions)


## 2. Check if 'pcs resource config' is able to display boolean meta attributes that are set to 'false'.

[root@virt-264 ~]# pcs resource create d2 ocf:pacemaker:Dummy

[root@virt-264 ~]# echo $?
0

[root@virt-264 ~]# pcs resource update d2 meta is_managed=false allow-unhealthy-nodes=false

[root@virt-264 ~]# echo $?
0


## 2.A. 'Text' format

[root@virt-264 ~]# pcs resource config --output-format text d2
Resource: d2 (class=ocf provider=pacemaker type=Dummy)
  Meta Attributes: d2-meta_attributes
    allow-unhealthy-nodes=false
    is_managed=false
  Operations:
    migrate_from: d2-migrate_from-interval-0s
      interval=0s
      timeout=20s
    migrate_to: d2-migrate_to-interval-0s
      interval=0s
      timeout=20s
    monitor: d2-monitor-interval-10s
      interval=10s
      timeout=20s
    reload: d2-reload-interval-0s
      interval=0s
      timeout=20s
    reload-agent: d2-reload-agent-interval-0s
      interval=0s
      timeout=20s
    start: d2-start-interval-0s
      interval=0s
      timeout=20s
    stop: d2-stop-interval-0s
      interval=0s
      timeout=20s

> Ok. 'Text' format displays boolean meta attributes that are set to 'false'.


## 2.B. 'CMD' format

[root@virt-264 ~]# pcs resource config --output-format cmd d2
pcs resource create --no-default-ops --force -- d2 ocf:pacemaker:Dummy \
  op \
    migrate_from interval=0s id=d2-migrate_from-interval-0s timeout=20s \
    migrate_to interval=0s id=d2-migrate_to-interval-0s timeout=20s \
    monitor interval=10s id=d2-monitor-interval-10s timeout=20s \
    reload interval=0s id=d2-reload-interval-0s timeout=20s \
    reload-agent interval=0s id=d2-reload-agent-interval-0s timeout=20s \
    start interval=0s id=d2-start-interval-0s timeout=20s \
    stop interval=0s id=d2-stop-interval-0s timeout=20s \
  meta allow-unhealthy-nodes=false is_managed=false

> Ok. 'CMD' format displays boolean meta attributes that are set to 'false'.


## 2.C. 'JSON' format

[root@virt-264 ~]# pcs resource config --output-format json d2 | fmt -w 80
{"primitives": [{"id": "d2", "agent_name": {"standard": "ocf", "provider":
"pacemaker", "type": "Dummy"}, "description": null, "operations": [{"id":
"d2-migrate_from-interval-0s", "name": "migrate_from", "interval":
"0s", "description": null, "start_delay": null, "interval_origin": null,
"timeout": "20s", "enabled": null, "record_pending": null, "role": null,
"on_fail": null, "meta_attributes": [], "instance_attributes": []},
{"id": "d2-migrate_to-interval-0s", "name": "migrate_to", "interval":
"0s", "description": null, "start_delay": null, "interval_origin": null,
"timeout": "20s", "enabled": null, "record_pending": null, "role":
null, "on_fail": null, "meta_attributes": [], "instance_attributes":
[]}, {"id": "d2-monitor-interval-10s", "name": "monitor", "interval":
"10s", "description": null, "start_delay": null, "interval_origin":
null, "timeout": "20s", "enabled": null, "record_pending": null, "role":
null, "on_fail": null, "meta_attributes": [], "instance_attributes":
[]}, {"id": "d2-reload-interval-0s", "name": "reload", "interval":
"0s", "description": null, "start_delay": null, "interval_origin": null,
"timeout": "20s", "enabled": null, "record_pending": null, "role": null,
"on_fail": null, "meta_attributes": [], "instance_attributes": []}, {"id":
"d2-reload-agent-interval-0s", "name": "reload-agent", "interval": "0s",
"description": null, "start_delay": null, "interval_origin": null,
"timeout": "20s", "enabled": null, "record_pending": null, "role":
null, "on_fail": null, "meta_attributes": [], "instance_attributes":
[]}, {"id": "d2-start-interval-0s", "name": "start", "interval": "0s",
"description": null, "start_delay": null, "interval_origin": null,
"timeout": "20s", "enabled": null, "record_pending": null, "role": null,
"on_fail": null, "meta_attributes": [], "instance_attributes": []}, {"id":
"d2-stop-interval-0s", "name": "stop", "interval": "0s", "description":
null, "start_delay": null, "interval_origin": null, "timeout": "20s",
"enabled": null, "record_pending": null, "role": null, "on_fail": null,
"meta_attributes": [], "instance_attributes": []}], "meta_attributes":
[{"id": "d2-meta_attributes", "options": {}, "rule": null, "nvpairs": [{"id":
"d2-meta_attributes-allow-unhealthy-nodes", "name": "allow-unhealthy-nodes",
"value": "false"}, {"id": "d2-meta_attributes-is_managed", "name":
"is_managed", "value": "false"}]}], "instance_attributes": [], "utilization":
[]}], "clones": [], "groups": [], "bundles": []}

> OK.

> Marking as VERIFIED for pcs-0.11.4-2.el9.x86_64

Comment 12 errata-xmlrpc 2023-05-09 07:18:34 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 (pcs 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:2151


Note You need to log in before you can comment on or make changes to this bug.