Bug 2151166
| Summary: | 'pcs resource config' fails to print boolean attributes set to false | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Tomas Jelinek <tojeline> | |
| Component: | pcs | Assignee: | Ondrej Mular <omular> | |
| Status: | CLOSED ERRATA | QA Contact: | cluster-qe <cluster-qe> | |
| Severity: | high | Docs Contact: | ||
| Priority: | high | |||
| Version: | 8.7 | CC: | cfeist, cluster-maint, cluster-qe, idevat, mlisik, mmazoure, mpospisi, nhostako, omular, svalasti, tojeline | |
| Target Milestone: | rc | Keywords: | Regression, Triaged, ZStream | |
| Target Release: | 8.8 | Flags: | pm-rhel:
mirror+
|
|
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | pcs-0.10.15-2.el8 | 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.
|
Story Points: | --- | |
| Clone Of: | 2151164 | |||
| : | 2151577 (view as bug list) | Environment: | ||
| Last Closed: | 2023-05-16 08:12:42 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: | 2151164 | |||
| Bug Blocks: | 2151577 | |||
| Deadline: | 2022-12-26 | |||
|
Description
Tomas Jelinek
2022-12-06 09:12:35 UTC
Upstream patch: https://github.com/ClusterLabs/pcs/commit/f9de2cbf0e17f4bdd1a81f329e7fa905b0e2e066 Test: [root@rhel87-node1 pcs]# pcs resource create dummy ocf:pacemaker:Dummy op monitor enabled=false [root@rhel87-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 DevTestResults:
[root@r08-08-a ~]# rpm -q pcs
pcs-0.10.15-2.el8.x86_64
[root@r08-08-a ~]# pcs resource create dummy ocf:pacemaker:Dummy op monitor enabled=false
[root@r08-08-a ~]# 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
## BEFORE
[root@virt-512 ~]# rpm -q pcs
pcs-0.10.15-1.el8.x86_64
[root@virt-512 ~]# pcs resource create d1 ocf:pacemaker:Dummy
[root@virt-512 ~]# pcs resource update d1 op monitor enabled=false meta is_managed=false
[root@virt-512 ~]# 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-512 ~]# 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-512 ~]# rpm -q pcs
pcs-0.10.15-2.el8.x86_64
## 1. Check if 'pcs resource config' is able to display boolean op attributes that are set to 'false'
[root@virt-512 ~]# pcs resource create d1 ocf:pacemaker:Dummy
[root@virt-512 ~]# echo $?
0
[root@virt-512 ~]# pcs resource update d1 op reload interval=10s enabled=false op monitor enabled=false
[root@virt-512 ~]# echo $?
0
## 1.A. 'Text' format ('pcs resource config --output-format text d1' is same as 'pcs resource config d1')
[root@virt-512 ~]# 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
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-512 ~]# 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. 'JSON' 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-512 ~]# pcs resource create d2 ocf:pacemaker:Dummy
[root@virt-512 ~]# echo $?
0
[root@virt-512 ~]# pcs resource update d2 meta is_managed=false allow-unhealthy-nodes=false
[root@virt-512 ~]# echo $?
0
## 2.A. 'Text' format
[root@virt-512 ~]# 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-512 ~]# 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-512 ~]# 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.10.15-2.el8.x86_64
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:2738 |