Bug 1159348

Summary: list --matched should show the filter string when warning about empty matches
Product: Red Hat Enterprise Linux 7 Reporter: Adrian Likins <alikins>
Component: subscription-managerAssignee: Chris "Ceiu" Rog <crog>
Status: CLOSED ERRATA QA Contact: John Sefler <jsefler>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: crog, redakkan
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-05 13:16:02 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: 1005618    

Description Adrian Likins 2014-10-31 16:09:40 UTC
Description of problem:
sudo bin/subscription-manager list --installed --matches rhel*

If you provide an unquoted string to --matches, and the shell expands it, it
is difficult to detect.

Not sure of a good way to detect that in the general case, but for the case of the filter string not matching anything, it would be useful if the filter string was included in the error:

[subscription-manager (master % u=)]$ sudo bin/subscription-manager list --installed --matches rhel*
No installed products were found that match the matches search string "rhel7_repos_list.txt"

multiple matches trigger arg parse warnings ala:
[subscription-manager (master % u=)]$ sudo bin/subscription-manager list --installed --matches subs*
cannot parse argument: subscription-manager.spec

That could be better (it doesn't show the first word in the expanded shell glob) but get's the point across.

Version-Release number of selected component (if applicable):
subscription-manager-1.13.6-1.el7.x86_64

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Chris "Ceiu" Rog 2014-12-11 18:11:13 UTC
commit 2884e33acb35ab4e336fe12dc23de7ab26cc0572
Author: Chris Rog <crog>
Date:   Mon Dec 8 13:39:58 2014 -0500

    1159348: Improved list error output when using list criteria
    
    - Specifying a service level or filter expression that filters all
      subscriptions or products will now print the criteria used in the
      query.

Comment 4 Rehana 2014-12-12 12:47:54 UTC
Retested on ,
# subscription-manager version 
server type: Red Hat Subscription Management
subscription management server: 0.9.26.4-1
subscription management rules: 5.11
subscription-manager: 1.13.12-1.el7
python-rhsm: 1.13.8-1.el7

# subscription-manager list --installed 

+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Red Hat Enterprise Linux Server
Product ID:     69
Version:        7.1 Beta
Arch:           x86_64
Status:         Subscribed
Status Details: 
Starts:         10/05/2011
Ends:           12/31/2021


# subscription-manager list --installed --matches rhel*

No installed products were found matching the expression "rhel*".
# subscription-manager list --installed --matches subs*

No installed products were found matching the expression "subs*".

# subscription-manager list --consumed --matches Self*
No consumed subscription pools were found matching the expression "Self*".

# subscription-manager list --consumed --matches Premium
No consumed subscription pools were found matching the expression "Premium".

Now list error output(using list criteria) prints the criteria used in the query in the error message.

Moving to Verified!!

Comment 6 errata-xmlrpc 2015-03-05 13:16:02 UTC
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, 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://rhn.redhat.com/errata/RHBA-2015-0502.html