Bug 2168617
| Summary: | Confusing error message in 'pcs constraint ticket add' when an unknown option is specified | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 9 | 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: | 9.0 | CC: | cluster-maint, idevat, mlisik, mmazoure, mpospisi, nhostako, omular, tojeline |
| Target Milestone: | rc | Keywords: | Triaged |
| Target Release: | 9.3 | Flags: | pm-rhel:
mirror+
|
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | pcs-0.11.5-1.el9 | Doc Type: | No Doc Update |
| Doc Text: |
This a minor self-documenting bugfix.
|
Story Points: | --- |
| Clone Of: | 2022748 | Environment: | |
| Last Closed: | 2023-11-07 08:23:10 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: | |||
| Bug Blocks: | 2022748 | ||
|
Description
Tomas Jelinek
2023-02-09 14:36:47 UTC
Upstream patch based on a pull request from a community: https://github.com/ClusterLabs/pcs/commit/c2cae53d4bac9b6c4c091ba56b7fc74968af3438 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@r09-03-a ~]# rpm -q pcs pcs-0.11.5-1.el9.x86_64 [root@r09-03-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-022 ~]# rpm -q pcs
pcs-0.11.4-7.el9_2.x86_64
[root@virt-022 ~]# 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 Promoted, Unpromoted, Started or Stopped.
[root@virt-022 ~]# pcs resource create d1 ocf:heartbeat:Dummy
[root@virt-022 ~]# echo $?
0
[root@virt-022 ~]# 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-525 ~]# rpm -q pcs
pcs-0.11.5-2.el9.x86_64
[root@virt-525 ~]# 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 Promoted, Unpromoted, Started or Stopped.
[root@virt-525 ~]# pcs resource create d1 ocf:heartbeat:Dummy
[root@virt-525 ~]# echo $?
0
A.) Checking the error message in case of entering an invalid option
[root@virt-525 ~]# 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-525 ~]# echo $?
1
> OK.
B.) Checking the error message in case of entering valid option with invalid value
[root@virt-525 ~]# 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-525 ~]# echo $?
1
> OK.
C.) Checking the error message in case of entering valid option with invalid option
[root@virt-525 ~]# 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-525 ~]# echo $?
1
> OK.
D.) Checking results in case of entering valid option
[root@virt-525 ~]# pcs constraint ticket add ticket1 d1 loss-policy=stop
[root@virt-525 ~]# echo $?
0
[root@virt-525 ~]# pcs constraint ticket
Ticket Constraints:
resource 'd1' depends on ticket 'ticket1'
loss-policy=stop
> OK.
> Marking as VERIFIED for pcs-0.11.5-2.el9.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 (Low: pcs security, 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/RHSA-2023:6316 |