Bug 1459874

Summary: hammer package list missing options repository and repository-id
Product: Red Hat Satellite Reporter: Djebran Lezzoum <dlezzoum>
Component: RepositoriesAssignee: Brad Buckingham <bbuckingham>
Status: CLOSED ERRATA QA Contact: Adam Ruzicka <aruzicka>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: aruzicka, bbuckingham, bkearney, dhlavacd, ehelms, jcallaha, rajgupta, tstrachota
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: tfm-rubygem-hammer_cli_katello-0.10.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:47:06 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:

Description Djebran Lezzoum 2017-06-08 12:28:26 UTC
Description of problem:
hammer package list missing options repository and repository-id


Version-Release number of selected component (if applicable):
* candlepin-2.0.35-1.el7.noarch
* candlepin-selinux-2.0.35-1.el7.noarch
* foreman-1.15.0-1.el7sat.noarch
* foreman-cli-1.15.0-1.el7sat.noarch
* foreman-compute-1.15.0-1.el7sat.noarch
* foreman-debug-1.15.0-1.el7sat.noarch
* foreman-discovery-image-3.1.1-22.el7sat.noarch
* foreman-ec2-1.15.0-1.el7sat.noarch
* foreman-gce-1.15.0-1.el7sat.noarch
* foreman-installer-1.15.0-1.el7sat.noarch
* foreman-installer-katello-3.4.0.1-1.el7sat.noarch
* foreman-libvirt-1.15.0-1.el7sat.noarch
* foreman-openstack-1.15.0-1.el7sat.noarch
* foreman-ovirt-1.15.0-1.el7sat.noarch
* foreman-postgresql-1.15.0-1.el7sat.noarch
* foreman-proxy-1.15.0-2.el7sat.noarch
* foreman-rackspace-1.15.0-1.el7sat.noarch
* foreman-selinux-1.15.0-1.el7sat.noarch
* foreman-vmware-1.15.0-1.el7sat.noarch
* katello-3.4.0-3.el7sat.noarch
* katello-ca-consumer-sat-r220-02.lab.eng.rdu2.redhat.com-1.0-1.noarch
* katello-certs-tools-2.4.0-1.el7sat.noarch
* katello-client-bootstrap-1.3.0-1.el7sat.noarch
* katello-common-3.4.0-3.el7sat.noarch
* katello-debug-3.4.0-3.el7sat.noarch
* katello-default-ca-1.0-1.noarch
* katello-installer-base-3.4.0.1-1.el7sat.noarch
* katello-selinux-3.0.2-1.el7sat.noarch
* katello-server-ca-1.0-1.noarch
* katello-service-3.4.0-3.el7sat.noarch
* openldap-2.4.40-13.el7.x86_64
* pulp-client-1.0-1.noarch
* pulp-docker-plugins-2.3.0-1.el7sat.noarch
* pulp-katello-1.0.2-1.el7sat.noarch
* pulp-ostree-plugins-1.2.1-1.el7sat.noarch
* pulp-puppet-plugins-2.12.2-1.el7sat.noarch
* pulp-puppet-tools-2.12.2-1.el7sat.noarch
* pulp-rpm-plugins-2.12.2-1.el7sat.noarch
* pulp-selinux-2.12.2-1.el7sat.noarch
* pulp-server-2.12.2-1.el7sat.noarch
* python-ldap-2.4.15-2.el7.x86_64
* tfm-rubygem-ldap_fluff-0.4.6-1.el7sat.noarch
* tfm-rubygem-net-ldap-0.15.0-1.el7sat.noarch


How reproducible:
Always

Steps to Reproduce:
1. hammer package list --organization="org_name" --product="product_name" --repository="repo_name"
2.
3.

Actual results:
Error: Unrecognised option '--repository'

See: 'hammer package list --help'
Error: Unrecognised option '--repository'

See: 'hammer package list --help'

Clamp::UsageError (Unrecognised option '--repository'):
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/option/parsing.rb:62:in `find_option'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/option/parsing.rb:28:in `parse_options'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:53:in `parse'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.10.0/lib/hammer_cli/abstract.rb:35:in `parse'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:67:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.10.0/lib/hammer_cli/abstract.rb:27:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.10.0/lib/hammer_cli/abstract.rb:27:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.10.0/lib/hammer_cli/abstract.rb:27:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:133:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.10.0/bin/hammer:146:in `<top (required)>'
    /usr/bin/hammer:23:in `load'
    /usr/bin/hammer:23:in `<main>'


Expected results:
organization product repository packages listed

Additional info:
the same behavior for repository-id option

the 2 options also missing from the help

hammer package list --help
Usage:
    hammer package list [OPTIONS]

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-content-view-id CONTENT_VIEW_VERSION_CONTENT_VIEW_ID Content view to search by
 --content-view-version-id CONTENT_VIEW_VERSION_ID                           Content view version identifier
 --environment ENVIRONMENT_NAME                                              Name to search by
 --environment-id ENVIRONMENT_ID                                              
 --full-result FULL_RESULT                                                   Whether or not to show all results
                                                                             One of true/false, yes/no, 1/0.
 --host HOST_NAME                                                            Name to search by
 --host-id HOST_ID                                                            
 --ids IDS                                                                   ids to filter content by
                                                                             Comma separated list of values. Values containing comma should be double quoted
 --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
 --packages-restrict-applicable PACKAGES_RESTRICT_APPLICABLE                 Only show packages that are applicable to hosts (defaults to true if
                                                                             host_id is specified)
                                                                             One of true/false, yes/no, 1/0.
 --packages-restrict-upgradable PACKAGES_RESTRICT_UPGRADABLE                 Only show packages that are upgradable in the host(s) Content View.
                                                                             One of true/false, yes/no, 1/0.
 --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
 --search SEARCH                                                             Search string
 -h, --help

Comment 2 Brad Buckingham 2017-06-13 10:40:10 UTC
With the latest upstream katello 3.4 builds below, I do see the --repository and --repository-id parameters; therefore, going to move this to POST for verification with the next build.

    tfm-rubygem-katello-3.4.0.2-2.el7.noarch
    tfm-rubygem-hammer_cli_katello-0.10.0-1.el7.noarch

hammer> package list --help
Usage:
     package list [OPTIONS]

Options:
 --by BY                                                     Field to sort the results on
 --content-view-filter CONTENT_VIEW_FILTER_NAME              Name to search by
 --content-view-filter-id CONTENT_VIEW_FILTER_ID             filter 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-result FULL_RESULT                                   Whether or not to show all results
                                                             One of true/false, yes/no, 1/0.
 --host HOST_NAME                                            Name to search by
 --host-id HOST_ID                                            
 --ids IDS                                                   ids to filter content by
                                                             Comma separated list of values. Values containing comma should be double quoted
 --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
 --packages-restrict-applicable PACKAGES_RESTRICT_APPLICABLE Only show packages that are applicable to hosts (defaults to true if
                                                             host_id is specified)
                                                             One of true/false, yes/no, 1/0.
 --packages-restrict-upgradable PACKAGES_RESTRICT_UPGRADABLE Only show packages that are upgradable in the host(s) Content View.
                                                             One of true/false, yes/no, 1/0.
 --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

Comment 3 Adam Ruzicka 2017-08-02 07:51:16 UTC
Verified.
Satellite-6.3 Snap 9
Hammer package list accepts the --repository or --repository-id options.
Package versions:
tfm-rubygem-hammer_cli_katello-0.10.0-1.el7sat.noarch
tfm-rubygem-hammer_cli-0.10.2-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_remote_execution-0.0.5-3.fm1_15.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_docker-0.0.4-4.el7sat.noarch
tfm-rubygem-hammer_cli_csv-2.3.0-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_discovery-1.0.0-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_tasks-0.0.10-3.fm1_15.el7sat.noarch
tfm-rubygem-hammer_cli_import-0.11.3-3.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_admin-0.0.6-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman-0.10.2-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_virt_who_configure-0.0.3-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_bootdisk-0.1.3-7.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_openscap-0.1.4-1.fm1_15.el7sat.noarch
katello-3.4.2-1.el7sat.noarch
satellite-6.3.0-16.0.beta.el7sat.noarch

[root@snap9 ~]# hammer package list --help
Usage:
    hammer package list [OPTIONS]

Options:
 --by BY                                                     Field to sort the results on
 --content-view-filter CONTENT_VIEW_FILTER_NAME              Name to search by
 --content-view-filter-id CONTENT_VIEW_FILTER_ID             filter 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-result FULL_RESULT                                   Whether or not to show all results
                                                             One of true/false, yes/no, 1/0.
 --host HOST_NAME                                            Name to search by
 --host-id HOST_ID
 --ids IDS                                                   ids to filter content by
                                                             Comma separated list of values. Values containing comma should be double quoted
 --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
 --packages-restrict-applicable PACKAGES_RESTRICT_APPLICABLE Only show packages that are applicable to hosts (defaults to true if
                                                             host_id is specified)
                                                             One of true/false, yes/no, 1/0.
 --packages-restrict-upgradable PACKAGES_RESTRICT_UPGRADABLE Only show packages that are upgradable in the host(s) Content View.
                                                             One of true/false, yes/no, 1/0.
 --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

[root@snap9 ~]# hammer package list --organization-id 1 --product 'Product 1' --repository-id 2
---|-------------------------------------|-----------
ID | FILENAME                            | SOURCE RPM
---|-------------------------------------|-----------
1  | redhat-ddns-client-1.3-4.noarch.rpm |
---|-------------------------------------|-----------

[root@snap9 ~]# hammer package list --organization-id 1 --product 'Product 1' --repository 'Repo 2'
---|-------------------------------------|-----------
ID | FILENAME                            | SOURCE RPM
---|-------------------------------------|-----------
1  | redhat-ddns-client-1.3-4.noarch.rpm |
---|-------------------------------------|-----------

Comment 4 Rajan Gupta 2017-08-11 11:36:42 UTC
Hello,

One of the Cu is facing an issue while running the command as below.

# hammer host package list --host-id  19
----------------------------------------
NVRA                                    
----------------------------------------
acl-2.2.51-12.el7.x86_64                
adwaita-cursor-theme-3.14.1-1.el7.noarch
adwaita-icon-theme-3.14.1-1.el7.noarch  
aic94xx-firmware-30-6.el7.noarch        
alsa-firmware-1.0.28-2.el7.noarch       
alsa-lib-1.1.1-1.el7.x86_64             
alsa-tools-firmware-1.1.0-1.el7.x86_64  
atk-2.14.0-1.el7.x86_64                 
at-spi2-atk-2.14.1-1.el7.x86_64         
at-spi2-core-2.14.1-2.el7.x86_64        
audit-2.6.5-3.el7_3.1.x86_64            
audit-libs-2.6.5-3.el7_3.1.x86_64       
audit-libs-python-2.6.5-3.el7_3.1.x86_64
authconfig-6.2.8-14.el7.x86_64          
avahi-libs-0.6.31-17.el7.x86_64         
basesystem-10.0-7.el7.noarch            
bash-4.2.46-21.el7_3.x86_64             
bind-libs-lite-9.9.4-38.el7_3.3.x86_64  
bind-license-9.9.4-38.el7_3.3.noarch    
binutils-2.25.1-22.base.el7.x86_64      
----------------------------------------
Page 1 of 26 (use --page and --per-page for navigation)
#

# hammer host package list  --host-id 19 --per-page 50
Error: Unrecognised option '--per-page'

See: 'hammer host package list --help'

Is this bugzilla is relevant to the same issue?

Please advice.

Regards,
Rajan

Comment 5 Bryan Kearney 2018-02-21 16:42:55 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/RHSA-2018:0336

Comment 6 Bryan Kearney 2018-02-21 16:47:06 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/RHSA-2018:0336

Comment 7 Satellite Program 2018-02-21 16:49:54 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/RHSA-2018:0336