Bug 1400235

Summary: hammer erratum list: Search with product name return all erratum
Product: Red Hat Satellite Reporter: Djebran Lezzoum <dlezzoum>
Component: Hammer - ContentAssignee: Andrew Kofink <akofink>
Status: CLOSED ERRATA QA Contact: Justin Sherrill <jsherril>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.3.0CC: akofink, bbuckingham, dhlavacd, inecas, jcallaha, jsherril, tstrachota
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:45:47 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 2016-11-30 17:36:46 UTC
Description of problem:
hammer erratum list: Search with product name return all erratum

Version-Release number of selected component (if applicable):
* candlepin-0.9.54.13-1.el7.noarch
* candlepin-selinux-0.9.54.13-1.el7.noarch
* foreman-1.13.1-1.el7.noarch
* foreman-compute-1.13.1-1.el7.noarch
* foreman-debug-1.13.1-1.el7.noarch
* foreman-discovery-image-3.1.1-17.el7sat.noarch
* foreman-ec2-1.13.1-1.el7.noarch
* foreman-gce-1.13.1-1.el7.noarch
* foreman-installer-1.13.1-1.el7.noarch
* foreman-installer-katello-3.2.0-3.rc4.el7.noarch
* foreman-libvirt-1.13.1-1.el7.noarch
* foreman-openstack-1.13.1-1.el7.noarch
* foreman-ovirt-1.13.1-1.el7.noarch
* foreman-postgresql-1.13.1-1.el7.noarch
* foreman-proxy-1.13.1-1.el7.noarch
* foreman-rackspace-1.13.1-1.el7.noarch
* foreman-selinux-1.13.1-1.el7.noarch
* foreman-vmware-1.13.1-1.el7.noarch
* katello-3.2.0-3.rc3.el7.noarch
* katello-certs-tools-2.4.0-1.el7sat.noarch
* katello-client-bootstrap-1.1.0-2.el7sat.noarch
* katello-common-3.2.0-3.rc3.el7.noarch
* katello-debug-3.2.0-3.rc3.el7.noarch
* katello-default-ca-1.0-1.noarch
* katello-installer-base-3.2.0-3.rc4.el7.noarch
* katello-selinux-3.0.1.2-1.el7sat.noarch
* katello-server-ca-1.0-1.noarch
* katello-service-3.2.0-3.rc3.el7.noarch
* openldap-2.4.40-13.el7.x86_64
* pulp-client-1.0-1.noarch
* pulp-docker-plugins-2.0.3-1.el7sat.noarch
* pulp-katello-1.0.2-1.el7.noarch
* pulp-ostree-plugins-1.1.3.1-1.el7sat.noarch
* pulp-puppet-plugins-2.9.1-1.el7.noarch
* pulp-puppet-tools-2.9.1-1.el7.noarch
* pulp-rpm-plugins-2.9.1-1.el7.noarch
* pulp-selinux-2.9.1-1.el7.noarch
* pulp-server-2.9.1-1.el7.noarch
* python-ldap-2.4.15-2.el7.x86_64
* tfm-rubygem-ldap_fluff-0.4.3-1.el7sat.noarch
* tfm-rubygem-net-ldap-0.15.0-1.el7.noarch

How reproducible:
Always

Steps to Reproduce:
1.Create two organizations - Org1 and Org2.
2.Create a repository and product in both the organizations and synchronize them.
  Make sure both the repositories have some erratum.
  the product name of Org1: Org1Product
  the product name of Org2: Org2Product
3. Now run the cli command:
hammer erratum list --product=Org1Product

Actual results:
The command runs without errors but displays all errata info from all products repositories,
 (as well as from product Org2Product repository) 

Expected results:
Error: please set one of options --organization, --organization-label, --organization-id


Additional info:
1- Alternatively the following commands works fine:
hammer erratum list --product=Org1Product --organization=Org1
hammer erratum list --product=Org1Product --organization-id=751
hammer erratum list --product=Org1Product --organization-label=Org1Label
hammer erratum list --product-id=460

# 460 is the ID of product name Org1Product
# 751 is the ID of organization Org1
# Org1Label is the label of organization Org1


2- similar bug:
https://bugzilla.redhat.com/show_bug.cgi?id=1180644

Comment 2 Andrew Kofink 2016-12-19 19:45:33 UTC
Created redmine issue http://projects.theforeman.org/issues/17766 from this bug

Comment 3 Bryan Kearney 2016-12-21 23:16:16 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/17766 has been resolved.

Comment 4 Justin Sherrill 2017-08-02 15:37:07 UTC
Verified in  6.3.0 Snap 9.0

# hammer -p changeme erratum list --product=product --organization-id=1
-------------------------------------|----------------|-------------|-------------------
ID                                   | ERRATA ID      | TYPE        | TITLE             
-------------------------------------|----------------|-------------|-------------------
f1da249c-f71e-41cb-b238-fa284ff20f3e | RHEA-2012:0058 | enhancement | Gorilla_Erratum   
a75248ec-71cc-4f1f-854b-6f39057fd41b | RHEA-2012:0055 | security    | Sea_Erratum       
a2bdfcb5-84ba-4720-9021-15d9410258fe | RHEA-2012:0057 | security    | Bear_ErratumPARTHA
247107f9-af23-4e53-b27b-90a014f5433e | RHEA-2012:0056 | security    | Bird_Erratum      
-------------------------------------|----------------|-------------|-------------------


another product's errata did not show up as expected.

Comment 5 Bryan Kearney 2018-02-21 16:41:58 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:45:47 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:51:07 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