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 1357557 - A new option --content-view-organization-id added to bunch of hammer sub-commands though intended for hostgroup cmd only
Summary: A new option --content-view-organization-id added to bunch of hammer sub-comm...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: Unspecified
Assignee: Andrew Kofink
QA Contact: Jitendra Yejare
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-18 13:44 UTC by Sachin Ghai
Modified: 2019-09-25 21:29 UTC (History)
5 users (show)

Fixed In Version: rubygem-hammer_cli_katello-0.0.22.23-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-27 11:39:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Sachin Ghai 2016-07-18 13:44:59 UTC
Description of problem:

I see a new change in hammer that introduces new failures in our automation. I see a new option  *content-view-organization-id* is added to bunch of hammer
sub-commands like:
 
activation-key, 
content-view filter/version, pulp-module add/remove
host subscription register,
hammer package-group list
hammer puppet-module list
hammer ostree-branch list
hammer docker manifest list
hammer host errata list


however this option is expected only for hostgroup not for others sub-commands.

Version-Release number of selected component (if applicable):
sat62 GA snap20.2

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:
--content-view-organization-id should be only for hostgroup not for all.

Additional info:

<sghai> ehelms, ping.. any idea about the addition of new option  *content-view-organization-id* in hammer sub-commands..?
<ehelms> sghai: how many commands or rather which ones do you see it for?
<sghai> ehelms, content-view/content-view version/filter etc..
<ehelms> sghai: no, that is not intentional, its supposed to exist for hostgroups only

Comment 2 Brad Buckingham 2016-07-18 17:01:11 UTC
Sachin, do those commands work in spite of the additional parameter?  Or is it requiring it to be provided?

Comment 4 Sachin Ghai 2016-07-19 13:04:04 UTC
(In reply to Brad Buckingham from comment #2)
> Sachin, do those commands work in spite of the additional parameter?  Or is
> it requiring it to be provided?

Most of the cmds are failing with error:

cv update:
===============

 LANG=en_US.UTF-8  hammer -v -u admin -p changeme --output=csv content-view update --id="467" --name="𧗢𩸅퉐𤧶㞨𤽤厲𤠼𨑏㾖"
2016-07-17 17:52:07 - robottelo.ssh - INFO - Instantiated Paramiko client 0x7f19b2bf9050
2016-07-17 17:52:10 - robottelo.ssh - INFO - Destroying Paramiko client 0x7f19b2bf9050
2016-07-17 17:52:10 - robottelo.ssh - INFO - Destroyed Paramiko client 0x7f19b2bf9050
2016-07-17 17:52:10 - robottelo.ssh - DEBUG - <<< stderr
[ERROR 2016-07-17 17:52:10 Exception] Error: Could not find organization, please set one of options --organization, --organization-label.
Could not update the content view:
  Error: Could not find organization, please set one of options --organization, --organization-label.
[ERROR 2016-07-17 17:52:10 Exception] 


Host subscription register:
===========================

 hammer -v -u admin -p changeme --output=csv host subscription register --lifecycle-environment="Library" --content-view-id="411" --organization-id="503" --name="qBzPPjQwuspOhMU"
2016-07-17 16:08:04 - robottelo.ssh - INFO - Instantiated Paramiko client 0x7fc68c021950
2016-07-17 16:08:06 - robottelo.ssh - INFO - Destroying Paramiko client 0x7fc68c021950
2016-07-17 16:08:06 - robottelo.ssh - INFO - Destroyed Paramiko client 0x7fc68c021950
2016-07-17 16:08:06 - robottelo.ssh - DEBUG - <<< stderr
[ERROR 2016-07-17 16:08:06 Exception] Error: Could not find organization, please set one of options --organization, --organization-label, --organization-id.
Failed to register host:
  Error: Could not find organization, please set one of options --organization, --organization-label, --organization-id.
[ERROR 2016-07-17 16:08:06 Exception] 




All content-view filter commands are affected with this. All required now org name/lable/id.

Comment 5 Jitendra Yejare 2016-07-20 13:25:59 UTC
As per comment 3, the fix is given for hostgroup issue is to use  '--organization-id' and not the 'content-view-organization-id', the same is tested and verified as below and is expected.

# hammer hostgroup update --id 2 --lifecycle-environment 'DEV' --content-view 'rhel7_cv' --organization-id 1
Hostgroup updated


# hammer hostgroup create --name 'hg2' --lifecycle-environment 'DEV' --content-view 'rhel7_cv' --operatingsystem 'RedHat 7.2' --organization-id 1 --partition-table 'Kickstart default' --subnet 'subnet1'
Hostgroup created


Other areas/subcommands the change is been reverted back to use '--organization-id' and not the 'content-view-organization-id'. And the unaffected/reverted area's are tested and verified as below" and are expected:

1. AK
# hammer activation-key info --help  | grep org
 --organization ORGANIZATION_NAME        Organization name to search by
 --organization-id ORGANIZATION_ID       organization ID
 --organization-label ORGANIZATION_LABEL Organization label to search by

# hammer activation-key create --help  | grep org
 --organization ORGANIZATION_NAME                    Organization name to search by
 --organization-id ORGANIZATION_ID                   organization ID
 --organization-label ORGANIZATION_LABEL             Organization label to search by


2. Content View filter/Version, puppet-module add / remove

# hammer content-view filter create --help | grep org
 --organization ORGANIZATION_NAME        Organization name to search by
 --organization-id ORGANIZATION_ID       organization ID
 --organization-label ORGANIZATION_LABEL Organization label to search by

# hammer content-view version info --help | grep org
 --organization ORGANIZATION_NAME        Organization name to search by
 --organization-id ORGANIZATION_ID       organization ID
 --organization-label ORGANIZATION_LABEL Organization label to search by

# hammer content-view version export --help | grep org
 --organization ORGANIZATION_NAME        Organization name to search by
 --organization-id ORGANIZATION_ID       organization ID
 --organization-label ORGANIZATION_LABEL Organization label to search by

# hammer content-view puppet-module add --help | grep org
 --organization ORGANIZATION_NAME        Organization name to search by
 --organization-id ORGANIZATION_ID       organization ID
 --organization-label ORGANIZATION_LABEL Organization label to search by

# hammer content-view puppet-module remove --help | grep org
 --organization ORGANIZATION_NAME        Organization name to search by
 --organization-id ORGANIZATION_ID       organization ID
 --organization-label ORGANIZATION_LABEL Organization label to search by


3. host subscription register:

# hammer host subscription register --help | grep org
 --organization ORGANIZATION_NAME                    Organization name to search by
 --organization-id ORGANIZATION_ID                   organization ID
 --organization-label ORGANIZATION_LABEL             Organization label to search by


4. hammer package-group list
# hammer package-group list --help | grep org
 --organization ORGANIZATION_NAME                    Organization name to search by
 --organization-id ORGANIZATION_ID                   organization ID
 --organization-label ORGANIZATION_LABEL             Organization label to search by


5. hammer puppet-module list
# hammer puppet-module list --help | grep org
 --organization ORGANIZATION_NAME                    Organization name to search by
 --organization-id ORGANIZATION_ID                   organization ID
 --organization-label ORGANIZATION_LABEL             Organization label to search by


6. hammer ostree-branch list
# hammer ostree-branch list --help | grep org
 --organization ORGANIZATION_NAME                    Organization name to search by
 --organization-id ORGANIZATION_ID                   organization ID
 --organization-label ORGANIZATION_LABEL             Organization label to search by


7. hammer docker manifest list
# hammer docker manifest list --help | grep org
 --organization ORGANIZATION_NAME                    Organization name to search by
 --organization-id ORGANIZATION_ID                   organization ID
 --organization-label ORGANIZATION_LABEL             Organization label to search by


So moving this bug to 'Verfied' state.

If this bug needs any more things to test feel free to reopen.

Comment 6 Bryan Kearney 2016-07-27 11:39:44 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:1501


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