Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1359665

Summary: Content-view filter and content-view update cmds should not requires --organization-id or --organization option
Product: Red Hat Satellite Reporter: Sachin Ghai <sghai>
Component: Content ViewsAssignee: Andrew Kofink <akofink>
Status: CLOSED ERRATA QA Contact: jcallaha
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: akofink, bbuckingham, bkearney, dlezzoum, inecas, jcallaha, mbacovsk, mmccune, zhunting
Target Milestone: UnspecifiedKeywords: Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/15889
Whiteboard:
Fixed In Version: tfm-rubygem-hammer_cli_katello-0.0.22.25-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1463516 (view as bug list) Environment:
Last Closed: 2016-08-16 07:11:37 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: 1463516    

Description Sachin Ghai 2016-07-25 09:14:12 UTC
Description of problem:
In ou automation we saw that bunch of cv filter and CV update tests are failing with below error:

 Error: Could not find organization, please set one of options --organization, --organization-label, --organization-id.


Earlier, automation was executing those tests without this error. I tried those tests manually and found same error like:


Create CV filter requires --organization/--organization-label/--organization-id.

----
 ~]# hammer -v -u admin -p changeme --output=csv content-view filter create --type="rpm" --content-view-id="1" --name="test" --inclusion="true"
[ERROR 2016-07-25 01:57:53 Exception] Error: Could not find organization, please set one of options --organization, --organization-label, --organization-id.
Could not create the filter:
  Error: Could not find organization, please set one of options --organization, --organization-label, --organization-id.
-----

with --organization-id it was created. However, I think it should be created without passing --organization-id option since we are passing cv id.

~]# hammer -v -u admin -p changeme --output=csv content-view filter create --type="rpm" --content-view-id="1" --name="test" --inclusion="true" --organization-id=1
Message,Id,Name
Filter created,1,test


Similar issue with following cmds:

- content-view update
- cv filter create/update/delete 


2016-07-23 17:52:31 - robottelo.ssh - DEBUG - >>> [qe-sat6-rhel6.satqe.lab.eng.rdu2.redhat.com] LANG=en_US.UTF-8  hammer -v -u admin -p changeme --output=csv content-view update --component-ids="327" --id="355"
2016-07-23 17:52:31 - robottelo.ssh - INFO - Instantiated Paramiko client 0x7f698efcfcd0
2016-07-23 17:52:33 - robottelo.ssh - INFO - Destroying Paramiko client 0x7f698efcfcd0
2016-07-23 17:52:33 - robottelo.ssh - INFO - Destroyed Paramiko client 0x7f698efcfcd0
2016-07-23 17:52:33 - robottelo.ssh - DEBUG - <<< stderr
[ERROR 2016-07-23 17:52:33 Exception] Error: Could not find organization, please set one of options --organization, --organization-label, --organization-id.
Could not update the content view:
  Error: Could not find organization, please set one of options --organization, --organization-label, --organization-id.
[ERROR 2016-07-23 17:52:33 Exception] 


Version-Release number of selected component (if applicable):
sat62 GA snap21.1 RC build

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:
cv filter create/update/delete cmds requires --organization-id option 

Expected results:
--organization-id was not required earlier. Moreover when user is passing CV-id then explicitly --organization/otganization-id option should not be required.

similar issue is with cv update, why user need to pass --organization-id

Additional info:

Comment 4 Ivan Necas 2016-07-26 07:09:16 UTC
Is this generic hammer or content specific bug?

Comment 5 Martin Bacovsky 2016-07-26 11:25:00 UTC
It is content specific, probably related to the bugs mentioned in c#1

Comment 6 Andrew Kofink 2016-07-28 17:15:04 UTC
Created redmine issue http://projects.theforeman.org/issues/15889 from this bug

Comment 7 jcallaha 2016-08-04 15:41:22 UTC
Verified in Satellite 6.2.1

[root@ibm-x3550m3-10 puppet]# hammer -v --output=csv content-view filter create --type="rpm" --content-view-id="1" --name="test" --inclusion="true"
Message,Id,Name
Filter created,1,test

Comment 9 errata-xmlrpc 2016-08-16 07:11:37 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/RHBA-2016:1615