Bug 2222744

Summary: `pcs property describe` does not raise an error for non-existent properties
Product: Red Hat Enterprise Linux 9 Reporter: Michal Pospisil <mpospisi>
Component: pcsAssignee: Peter Romancik <promanci>
Status: CLOSED MIGRATED QA Contact: cluster-qe <cluster-qe>
Severity: low Docs Contact:
Priority: low    
Version: 9.3CC: cluster-maint, idevat, mlisik, mmazoure, mpospisi, omular, tojeline
Target Milestone: rcKeywords: MigratedToJIRA, Triaged
Target Release: 9.4Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: Filter function skipped check for properties without metadata in commands `pcs property describe` and `pcs property defaults`. Consequence: If specified properties in the commands `pcs property describe` and `pcs property defaults` did not have metadata no error was displayed. Fix: Fix filter function to check properties without metadata. Result: If specified properties in the commands do not have metadata error message is printed.
Story Points: ---
Clone Of:
: 2226778 (view as bug list) Environment:
Last Closed: 2023-09-22 20:26:52 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: 2226778    

Description Michal Pospisil 2023-07-13 15:47:23 UTC
Description of problem:
When a cluster property that does not exist is supplied to the `pcs property describe` command, nothing is printed out and the return value is 0 (success). There should be some kind of an error in this case.

Version-Release number of selected component (if applicable):
pcs-0.11.6-2.el9

How reproducible:
always, easily

Steps to Reproduce:
1. Run `pcs property describe nonexistent`

Actual results:
# pcs property describe nonexistent

# echo $?
0

Expected results:
An error is printed and pcs exits with a non-zero return code. 

Additional info:

Comment 1 Peter Romancik 2023-08-01 08:11:24 UTC
Upstream commit: https://github.com/ClusterLabs/pcs/commit/91852cc4971c9002bd1cefc250bdca57ba68fbbd

Updated commands:
* pcs property describe
* pcs property defaults

Test:
# pcs property describe nonexistent
Error: No description for property: 'nonexistent'
# echo $?
1

# pcs property defaults nonexistent1 nonexistent2
Error: No default value for properties: 'nonexistent1', 'nonexistent2'
# echo $?
1

Comment 3 RHEL Program Management 2023-09-22 20:24:33 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 4 RHEL Program Management 2023-09-22 20:26:52 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.