Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1151925

Summary: [RFE] Display appropriate message when no repos found by --list-enabled/disable filters
Product: Red Hat Enterprise Linux 7 Reporter: Rehana <redakkan>
Component: subscription-managerAssignee: Chris "Ceiu" Rog <crog>
Status: CLOSED ERRATA QA Contact: John Sefler <jsefler>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.1CC: crog, wpoteat
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-05 13:15:34 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 Rehana 2014-10-13 06:17:48 UTC
Description of problem:
Observed that when no "Repositories" found by the --list-enabled/disabled filters,it displays a empty "Available repositories" list.I Suggest to display message instead of displaying an empty list


Version-Release number of selected component (if applicable):
subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 0.9.32-1
subscription management rules: 5.11
subscription-manager: 1.13.5-1.git.0.1e307d9.el7
python-rhsm: 1.13.3-1.git.0.14a214e.el7


How reproducible:
100%

Steps to Reproduce:
1.Register and attach a pool 
# subscription-manager attach --auto
Installed Product Current Status:
Product Name: Awesome OS for All Arch (x86 content) Bits
Status:       Subscribed

# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name: Awesome OS for All Arch (x86content)
Provides:          Awesome OS for All Arch (x86 content) Bits
SKU:               awesomeos-all-x86-cont
Contract:          0
Account:           12331131231
Serial:            6671365991574071606
Pool ID:           ff80808148efdeee0148efdf83c30f27
Active:            True
Quantity Used:     2
Service Level:     
Service Type:      
Status Details:    
Subscription Type: Stackable
Starts:            10/07/2014
Ends:              10/07/2015
System Type:       Physical

2.Repo list 

# subscription-manager repos --list
+----------------------------------------------------------+
    Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID:   never-enabled-content
Repo Name: never-enabled-content
Repo URL:  https://cdn.redhat.com/foo/path/never
Enabled:   1

Repo ID:   awesomeos-x86_64-i386-content
Repo Name: awesomeos-x86_64-i386-content
Repo URL:  https://cdn.redhat.com/path/to/awesomeos/all
Enabled:   1


3. Repo --list-disabled, Observed that empty list was displayed

]# subscription-manager repos --list-disabled 
+----------------------------------------------------------+
    Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
[root@dell-per620-02 ~]# 

Actual results:
Observed that when no "Repositories" found by the --list-enabled/disabled filters,it displays a empty "Available repositories" list

Expected results:

Appropriate error message  should display ,like
when --list-disabled  filter is used
 "This system has no disabled repositories available through subscriptions" 

similarly it should show for --list-enabled filter as well 

Additional info:

Comment 1 Chris "Ceiu" Rog 2014-10-23 15:26:09 UTC
commit 2e6faa56ecb0ddb5a0b7b9bb4ac381a537a24cfe
Merge: cc35586 72e2193
Author: Adrian Likins <alikins>
Date:   Thu Oct 23 11:19:05 2014 -0400

    Merge pull request #1039 from candlepin/crog/1151925
    
    1151925: Improved filtered listing output when results are empty.

Comment 3 Rehana 2014-11-04 04:33:05 UTC
Retester on,

# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 0.9.32-1
subscription management rules: 5.11
subscription-manager: 1.13.7-1.el7
python-rhsm: 1.13.6-1.el7

1) Registered and attached pool
# subscription-manager attach --auto
Installed Product Current Status:
Product Name: Awesome OS Server Bits
Status:       Subscribed

2) Repo list 

# subscription-manager repos --list
+----------------------------------------------------------+
    Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID:   content-label-empty-gpg
Repo Name: content-emptygpg
Repo URL:  https://cdn.redhat.com/foo/path
Enabled:   0

Repo ID:   content-label
Repo Name: content
Repo URL:  https://cdn.redhat.com/foo/path
Enabled:   0

Repo ID:   content-label-no-gpg
Repo Name: content-nogpg
Repo URL:  https://cdn.redhat.com/foo/path
Enabled:   0

Repo ID:   never-enabled-content
Repo Name: never-enabled-content
Repo URL:  https://cdn.redhat.com/foo/path/never
Enabled:   0

3) --list-enabled on the client
# subscription-manager repos --list-enabled 
There were no available repositories matching the specified criteria.

Observed that ^^ above message is displayed when no repositories found by the list-enabled

4) Now enable all repos and try --list-disabled

# subscription-manager repos --enable=*
Repository 'content-label-empty-gpg' is enabled for this system.
Repository 'content-label' is enabled for this system.
Repository 'content-label-no-gpg' is enabled for this system.
Repository 'never-enabled-content' is enabled for this system.

# subscription-manager repos --list-disabled 
There were no available repositories matching the specified criteria.

Observed that ^^ above message is displayed when no repositories found by the list-disabled

Marking verified.

Comment 5 errata-xmlrpc 2015-03-05 13:15:34 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