Bug 1493711

Summary: subscription-manager list --available --matches="foobar" is failing to filter pools
Product: Red Hat Enterprise Linux 7 Reporter: John Sefler <jsefler>
Component: subscription-managerAssignee: Alex Wood <awood>
Status: CLOSED ERRATA QA Contact: John Sefler <jsefler>
Severity: medium Docs Contact:
Priority: high    
Version: 7.5CC: awood, khowell, redakkan, skallesh
Target Milestone: rcKeywords: Regression, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: subscription-manager-1.20.2-1 Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 09:52:05 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:

Description John Sefler 2017-09-20 18:26:56 UTC
Description of problem:
The --matches option on subscription-manager list --available is failing to filter any pools.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. register to account with available subscription pools
2. run...
[root@jsefler-rhel7 ~]# subscription-manager list --available --matches="foobar"
+-------------------------------------------+
    Available Subscriptions
+-------------------------------------------+
Subscription Name:   Admin OS Server Bundled (2 Sockets, Standard Support)
Provides:            Awesome OS Server Bits
                     Clustering Bits
                     Load Balancing Bits
                     Shared Storage Bits
                     Large File Support Bits
                     Management Bits
                     Admin OS Premium Architecture Bits
                     Admin OS Developer Bits
SKU:                 adminos-server-2-socket-std
Contract:            1
Pool ID:             8a90860f5e9c2769015e9c28f81201b3
Provides Management: Yes
Available:           10
Suggested:           1
Service Level:       Standard
Service Type:        L1-L3
Subscription Type:   Standard
Ends:                09/18/2018
System Type:         Physical
<...snip...>

Actual results:
  all of the available pools are listed without any regard for --matches

Expected results:
  No available subscription pools were found matching the expression "foobar".



Additional info:

[root@jsefler-rhel7 ~]# tail -f /var/log/rhsm/rhsm.log
2017-09-20 14:22:40,089 [DEBUG] subscription-manager:11974:MainThread @connection.py:515 - Making request: GET /candlepin/owners/admin/pools?consumer=5d02bfaf-4b49-4ebc-ac52-1ee2b6bf426e
2017-09-20 14:22:40,415 [INFO] subscription-manager:11974:MainThread @connection.py:556 - Response: status=200, requestUuid=4ca6ae04-ddf5-4e0d-b208-e2aadc85aa6f, request="GET /candlepin/owners/admin/pools?consumer=5d02bfaf-4b49-4ebc-ac52-1ee2b6bf426e"
2017-09-20 14:22:40,418 [DEBUG] subscription-manager:11974:MainThread @managerlib.py:544 - Filtering 0 total pools
2017-09-20 14:22:40,418 [DEBUG] subscription-manager:11974:MainThread @managerlib.py:550 - 	Removed 0 incompatible pools
2017-09-20 14:22:40,418 [DEBUG] subscription-manager:11974:MainThread @managerlib.py:583 - 	23 pools to display, -23 filtered out

Comment 2 John Sefler 2017-09-20 19:14:29 UTC
Using git bisect, I found the offending commit for this regression behavior was...

da72dfcbbb2c3a44393edb9e46e1583d05cc140a is the first bad commit
commit da72dfcbbb2c3a44393edb9e46e1583d05cc140a
Author: Alex Wood <awood@redhat.com>
Date:   Mon Jul 31 16:29:29 2017 -0400

    Add an entitlement service and use it in the CLI and DBus.

Comment 4 Shwetha Kallesh 2017-11-07 10:57:01 UTC
Verified!!

[root@hp-ms-01-c02 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.2.0-1
subscription management rules: 5.26
subscription-manager: 1.20.5-1.el7


[root@hp-ms-01-c02 ~]# subscription-manager list --available --matches="foobar"
No available subscription pools were found matching the expression "foobar".

Comment 7 errata-xmlrpc 2018-04-10 09:52:05 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://access.redhat.com/errata/RHBA-2018:0681