Bug 2222744 - `pcs property describe` does not raise an error for non-existent properties
Summary: `pcs property describe` does not raise an error for non-existent properties
Keywords:
Status: POST
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: pcs
Version: 9.3
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: 9.4
Assignee: Peter Romancik
QA Contact: cluster-qe
URL:
Whiteboard:
Depends On:
Blocks: 2226778
TreeView+ depends on / blocked
 
Reported: 2023-07-13 15:47 UTC by Michal Pospisil
Modified: 2023-08-15 07:12 UTC (History)
6 users (show)

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.
Clone Of:
: 2226778 (view as bug list)
Environment:
Last Closed:
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-162305 0 None None None 2023-07-13 16:05:48 UTC

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


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