Red Hat Satellite engineering is moving the tracking of its product development work on Satellite 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 "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. 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 "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-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 1933353 - 'hammer host subscription product-content' Cannot Show 'Default Enabled?' Field
Summary: 'hammer host subscription product-content' Cannot Show 'Default Enabled?' Field
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: 6.8.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.10.0
Assignee: Oleh Fedorenko
QA Contact: Shweta Singh
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-02-26 19:12 UTC by Bernie Hoefer
Modified: 2022-03-07 08:26 UTC (History)
7 users (show)

Fixed In Version: tfm-rubygem-hammer_cli-2.5.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-16 14:39:05 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 31984 0 Normal New 'hammer host subscription product-content' Cannot Show 'Default Enabled?' Field 2021-03-01 18:24:14 UTC
Red Hat Product Errata RHBA-2021:4701 0 None None None 2021-11-16 14:39:12 UTC

Description Bernie Hoefer 2021-02-26 19:12:48 UTC
Description of problem:

According to 'hammer host subscription product-content --help', I should be able to restrict the output fields.  I cannot do that for the "Default Enabled?" field.


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

tfm-rubygem-hammer_cli-2.1.2-1.el7sat.noarch


How reproducible:

# hammer host subscription product-content --host contenthost.localdomain --fields="label,default enabled?,override"


Actual results:

---------------------------------------|----------
LABEL                                  | OVERRIDE 
---------------------------------------|----------
rhel-7-server-rpms                     | enabled:0
rhel-7-server-eus-rpms                 |          
rhel-7-server-extras-rpms              |          
rhel-8-for-x86_64-appstream-rpms       |          
rhel-8-for-x86_64-appstream-eus-rpms   |          
rhel-8-for-x86_64-baseos-rpms          |          
rhel-8-for-x86_64-baseos-eus-rpms      |          
rhel-7-server-satellite-tools-6.8-rpms |          
---------------------------------------|----------


Expected results:

---------------------------------------|------------------|----------
LABEL                                  | DEFAULT ENABLED? | OVERRIDE 
---------------------------------------|------------------|----------
rhel-7-server-rpms                     | yes              | enabled:0
rhel-7-server-eus-rpms                 | no               |          
rhel-7-server-extras-rpms              | no               |          
rhel-8-for-x86_64-appstream-rpms       | yes              |          
rhel-8-for-x86_64-appstream-eus-rpms   | no               |          
rhel-8-for-x86_64-baseos-rpms          | yes              |          
rhel-8-for-x86_64-baseos-eus-rpms      | no               |          
rhel-7-server-satellite-tools-6.8-rpms | no               |          
---------------------------------------|------------------|----------


Additional info:

I'm sure it is the question mark that is that is throwing my --fields option off.  I've tried escaping it, leaving it off and about 10 other variations to no success.

Not sure if this is an actual bug with the hammer program or a documentation issue.  (The documentation could definitely be improved, as the --help output shows:

  -----------------|-----|---------|-----
  FIELDS           | ALL | DEFAULT | THIN
  -----------------|-----|---------|-----
  ID               | x   | x       | x
  Name             | x   | x       | x
  Type             | x   | x       |
  URL              | x   | x       |
  GPG Key          | x   | x       |
  Label            | x   | x       |
  Default Enabled? | x   | x       |
  Override         | x   | x       |
  -----------------|-----|---------|-----

...yet trying to use --fields="ID" just shows blank lines.  One has to use "Id" or "id".

Comment 1 Oleh Fedorenko 2021-03-01 17:53:21 UTC
This is actually a bug in hammer core. --fields option doesn't work if a label contains question mark (it interprets that as regexp).

Comment 2 Oleh Fedorenko 2021-03-01 18:24:13 UTC
Created redmine issue https://projects.theforeman.org/issues/31984 from this bug

Comment 3 Bryan Kearney 2021-03-01 20:05:41 UTC
Upstream bug assigned to ofedoren

Comment 4 Bryan Kearney 2021-03-01 20:05:45 UTC
Upstream bug assigned to ofedoren

Comment 6 Bryan Kearney 2021-05-11 12:06:03 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/31984 has been resolved.

Comment 7 Shweta Singh 2021-06-24 08:14:57 UTC
Verified. 

Version Tested : Satellite 6.10 Snap 4

Steps followed: 
1. Create host on satellite                                                                                                                                                                                                                         
2. Add Redhat repositories on satellite
3. Execute hammer command to restrict the output fields using command "hammer host subscription product-content --host host1.localdomain --fields="label,default enabled?,override""

Observation:
hammer host subscription product-content --help gives option to restrict output fields.
 
Trace:

hammer host subscription product-content --host host1.localdomain --fields="label,default enabled?,override"
----------------------------------|------------------|---------
LABEL                             | DEFAULT ENABLED? | OVERRIDE
----------------------------------|------------------|---------
rhel-7-server-ansible-2.9-rpms    | no               |         
rh-sso-7.4-for-rhel-7-server-rpms | no               |         
----------------------------------|------------------|---------

hammer host subscription product-content --host host1.localdomain --fields="label,default enabled?,override,id"
-----|-----------------------------------|------------------|---------
ID   | LABEL                             | DEFAULT ENABLED? | OVERRIDE
-----|-----------------------------------|------------------|---------
628  | rhel-7-server-ansible-2.9-rpms    | no               |         
5990 | rh-sso-7.4-for-rhel-7-server-rpms | no               |         
-----|-----------------------------------|------------------|---------

Comment 10 errata-xmlrpc 2021-11-16 14:39: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 (Satellite 6.10 Satellite Tools Release), 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-2021:4701


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