Bug 1361473

Summary: [RFE] - Display the errata or packages that would applicable/installable for a given host using Hammer CLI
Product: Red Hat Satellite Reporter: Nagoor Shaik <nshaik>
Component: Hammer - ContentAssignee: David Davis <daviddavis>
Status: CLOSED ERRATA QA Contact: Daniel Lobato Garcia <dlobatog>
Severity: medium Docs Contact:
Priority: high    
Version: 6.2.0CC: bbuckingham, daviddavis, dlobatog, jcallaha
Target Milestone: UnspecifiedKeywords: FutureFeature, Triaged
Target Release: Unused   
Hardware: All   
OS: All   
URL: http://projects.theforeman.org/issues/16533
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 12:35:52 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:

Comment 1 Bryan Kearney 2016-09-13 14:18:05 UTC
Upstream bug component is Hammer - Content

Comment 2 David Davis 2016-09-16 16:34:38 UTC
We've added the ability to view packages that are applicable or upgradable for a host (much like you can do now with errata). To view the upgradable packages for host with id 1, you'd do:

   hammer package list --host-id 1 --packages-restrict-upgradable true

It's not 100% clear to me if this solves the RFE but feel free to respond/reopen.

Comment 3 Nagoor Shaik 2016-09-21 14:02:02 UTC
Hi David,

There is no sub-option such as --host-id in Satellite 6.2.2 

 # hammer package list --help
    hammer package list [OPTIONS]

 --by BY                                             Field to sort the results on
 --content-view CONTENT_VIEW_NAME                    Content view name to search by
 --content-view-filter CONTENT_VIEW_FILTER_NAME      Name to search by
 --content-view-filter-id CONTENT_VIEW_FILTER_ID     filter identifier
 --content-view-id CONTENT_VIEW_ID                   content view numeric identifier
 --content-view-version CONTENT_VIEW_VERSION_VERSION Content view version number
 --content-view-version-id CONTENT_VIEW_VERSION_ID   Content view version identifier
 --environment ENVIRONMENT_NAME                      Name to search by
 --environment-id ENVIRONMENT_ID                      
 --full-results FULL_RESULTS                         Whether or not to show all results
                                                     One of true/false, yes/no, 1/0.
 --ids IDS                                           ids to filter content by
                                                     Comma separated list of values.
 --order ORDER                                       Sort field and order, eg. 'name DESC'
 --organization ORGANIZATION_NAME                    Organization name to search by
 --organization-id ORGANIZATION_ID                   organization ID
 --organization-label ORGANIZATION_LABEL             Organization label to search by
 --page PAGE                                         Page number, starting at 1
 --per-page PER_PAGE                                 Number of results per page to return
 --product PRODUCT_NAME                              Product name to search by
 --product-id PRODUCT_ID                             product numeric identifier
 --repository REPOSITORY_NAME                        Repository name to search by
 --repository-id REPOSITORY_ID                       repository ID
 --search SEARCH                                     Search string
 -h, --help                                          print help

 rpm -qa | grep hammer

Comment 4 Bryan Kearney 2016-09-22 18:18:22 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/16533 has been resolved.

Comment 6 Daniel Lobato Garcia 2017-08-23 09:40:33 UTC

Version Tested: Satellite-6.3 Snap 12

Running `hammer host info --id 1` returns now the applicable/upgradable packages in Content Information:

Content Information:
    Content View:
    Lifecycle Environment:
    Applicable Packages:
    Upgradable Packages:
    Applicable Errata:
        Bug Fix:

Comment 9 errata-xmlrpc 2018-02-21 12:35:52 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.