Bug 2022748
Summary: | Confusing error message in 'pcs constraint ticket add' when an unknown option is specified | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 8 | Reporter: | Tomas Jelinek <tojeline> | |
Component: | pcs | Assignee: | Tomas Jelinek <tojeline> | |
Status: | CLOSED ERRATA | QA Contact: | cluster-qe <cluster-qe> | |
Severity: | low | Docs Contact: | ||
Priority: | low | |||
Version: | 8.6 | CC: | cluster-maint, idevat, mlisik, mmazoure, mpospisi, nhostako, omular, tojeline | |
Target Milestone: | rc | Keywords: | Triaged | |
Target Release: | 8.9 | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | pcs-0.10.16-1.el8 | Doc Type: | No Doc Update | |
Doc Text: |
This a minor self-documenting issue.
|
Story Points: | --- | |
Clone Of: | ||||
: | 2168617 (view as bug list) | Environment: | ||
Last Closed: | 2023-11-14 15:22:35 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: | 2168617 | |||
Bug Blocks: |
Description
Tomas Jelinek
2021-11-12 13:59:26 UTC
Upstream patch based on a pull request from a community: https://github.com/ClusterLabs/pcs/commit/4da2e7148d22ce87736a2c036d1eceff5a9d830f Test: # pcs constraint ticket add ticket d1 unknown=option Error: invalid option 'unknown', allowed options are: 'id', 'loss-policy' Error: Errors have occurred, therefore pcs is unable to continue DevTestResults: [root@r08-09-a ~]# rpm -q pcs pcs-0.10.16-1.el8.x86_64 [root@r08-09-a ~]# pcs constraint ticket add ticket r1 unknown=option Error: invalid option 'unknown', allowed options are: 'id', 'loss-policy' Error: Errors have occurred, therefore pcs is unable to continue ## BEFORE [root@virt-544 ~]# rpm -q pcs pcs-0.10.15-4.el8_8.1.x86_64 [root@virt-544 ~]# pcs constraint ticket add -h Usage: pcs constraint [constraints]... ticket add <ticket> [<role>] <resource id> [<options>] [id=<constraint-id>] Create a ticket constraint for <resource id>. Available option is loss-policy=fence/stop/freeze/demote. A role can be master, slave, started or stopped. [root@virt-544 ~]# pcs resource create d1 ocf:heartbeat:Dummy [root@virt-544 ~]# echo $? 0 [root@virt-544 ~]# pcs constraint ticket add ticket1 d1 invalid-option=false Error: invalid option 'invalid-option', allowed options are: 'id', 'loss-policy', 'rsc', 'rsc-role', 'ticket' > When an unknown option is specified, then the list of allowed options contains positional arguments such as resource, resource-role and ticket. ## AFTER [root@virt-539 ~]# rpm -q pcs pcs-0.10.16-1.el8.x86_64 [root@virt-539 ~]# pcs constraint ticket add -h Usage: pcs constraint [constraints]... ticket add <ticket> [<role>] <resource id> [<options>] [id=<constraint-id>] Create a ticket constraint for <resource id>. Available option is loss-policy=fence/stop/freeze/demote. A role can be master, slave, started or stopped. [root@virt-539 ~]# pcs resource create d1 ocf:heartbeat:Dummy [root@virt-539 ~]# echo $? 0 A.) Checking the error message in case of entering an invalid option [root@virt-539 ~]# pcs constraint ticket add ticket1 d1 invalid-option=false Error: invalid option 'invalid-option', allowed options are: 'id', 'loss-policy' Error: Errors have occurred, therefore pcs is unable to continue [root@virt-539 ~]# echo $? 1 > OK. B.) Checking the error message in case of entering valid option with invalid value [root@virt-539 ~]# pcs constraint ticket add ticket1 d1 loss-policy=9 Error: '9' is not a valid loss-policy value, use 'demote', 'fence', 'freeze', 'stop' Error: Errors have occurred, therefore pcs is unable to continue [root@virt-539 ~]# echo $? 1 > OK. C.) Checking the error message in case of entering valid option with invalid option [root@virt-539 ~]# pcs constraint ticket add ticket1 d1 loss-policy=stop invalid-option=false Error: invalid option 'invalid-option', allowed options are: 'id', 'loss-policy' Error: Errors have occurred, therefore pcs is unable to continue [root@virt-539 ~]# echo $? 1 > OK. D.) Checking results in case of entering valid option [root@virt-539 ~]# pcs constraint ticket add ticket1 d1 loss-policy=stop [root@virt-539 ~]# echo $? 0 [root@virt-539 ~]# pcs constraint ticket Ticket Constraints: d1 loss-policy=stop ticket=ticket1 > OK. > Marking as VERIFIED for pcs-0.10.16-1.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:6903 |