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 1230153

Summary: Cannot list Available-repositories in repository set using hammer cli in nightly
Product: Red Hat Satellite Reporter: Tazim Kolhar <tkolhar>
Component: HammerAssignee: Brad Buckingham <bbuckingham>
Status: CLOSED ERRATA QA Contact: Og Maciel <omaciel>
Severity: high Docs Contact: David O'Brien <daobrien>
Priority: unspecified    
Version: NightlyCC: bbuckingham, bkearney, cwelton, mmccune, omaciel
Target Milestone: UnspecifiedKeywords: ReleaseNotes, Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-10-15 18:20:09 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: 1190823    

Description Tazim Kolhar 2015-06-10 11:08:13 UTC
Description of problem:
Cannot list  Available-repositories in repository set using hammer cli in nightly

Version-Release number of selected component (if applicable):
nightly

How reproducible:
everytime

Steps to Reproduce:
1.LANG=en_US.UTF-8 hammer -v -u admin -p changeme --output=csv repository-set available-repositories --product="Red Hat Enterprise Linux Server" --name="Red Hat Enterprise Virtualization Agents for RHEL 6 Server (RPMs)" --organization-id="302"
[ERROR 2015-06-07 22:37:26 Exception] Error: product not found
Error: product not found
[ERROR 2015-06-07 22:37:26 Exception] 

HammerCLIForeman::ResolverError (product not found):
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.2.0/lib/hammer_cli_foreman/id_resolver.rb:200:in `pick_result'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.2.0/lib/hammer_cli_foreman/id_resolver.rb:160:in `find_resource'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.2.0/lib/hammer_cli_foreman/id_resolver.rb:143:in `get_id'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.2.0/lib/hammer_cli_foreman/id_resolver.rb:133:in `product_id'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.2.0/lib/hammer_cli_foreman/commands.rb:149:in `send'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.2.0/lib/hammer_cli_foreman/commands.rb:149:in `get_resource_id'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.2.0/lib/hammer_cli_foreman/commands.rb:218:in `customized_options'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.2.0/lib/hammer_cli_foreman/commands.rb:215:in `each'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.2.0/lib/hammer_cli_foreman/commands.rb:215:in `customized_options'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.2.0/lib/hammer_cli_foreman/commands.rb:239:in `request_params'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_katello-0.0.14/lib/hammer_cli_katello/repository_set.rb:58:in `request_params'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.2.0/lib/hammer_cli/./apipie/command.rb:43:in `send_request'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.2.0/lib/hammer_cli_foreman/commands.rb:185:in `send_request'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.2.0/lib/hammer_cli_foreman/commands.rb:275:in `send_request'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.2.0/lib/hammer_cli_foreman/commands.rb:298:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.2.0/lib/hammer_cli/./apipie/../abstract.rb:23:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.2.0/lib/hammer_cli/./apipie/../abstract.rb:23:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.2.0/lib/hammer_cli/./apipie/../abstract.rb:23:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.2.0/bin/hammer:108
    /usr/bin/hammer:19:in `load'
    /usr/bin/hammer:19

2.Stacktrace

  File "/usr/lib64/python2.7/unittest/case.py", line 369, in run
    testMethod()
  File "/home/jenkins/workspace/satellite6-automation-upstream-rhel66-cli/tests/foreman/cli/test_repository_set.py", line 57, in test_repositoryset_available_repositories
    self.assertEqual(result.return_code, 0)
  File "/usr/lib64/python2.7/unittest/case.py", line 553, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/usr/lib64/python2.7/unittest/case.py", line 546, in _baseAssertEqual
    raise self.failureException(msg)
'70 != 0\n--------------------
3.

Actual results:
the command fails

Expected results:
the command works fine

Additional info:
will attach foreman-debug when system is up and running

Comment 2 Mike McCune 2015-07-09 21:49:25 UTC
I reproduced this, the workaround is to use ID instead of product name.

Comment 3 Mike McCune 2015-07-09 22:36:01 UTC
*** Bug 1230155 has been marked as a duplicate of this bug. ***

Comment 5 Brad Buckingham 2015-09-16 16:15:35 UTC
I am not able to reproduce this bug on either the upstream or downstream; therefore, moving it to ON_QA for verification.

upstream: (lastest code)

$ LANG=en_US.UTF-8 bundle exec hammer -v -u admin -p changeme --output=csv repository-set list --product="Red Hat Enterprise Linux Server" --name="Red Hat Enterprise Virtualization Agents for RHEL 6 Server (RPMs)" --organization-id=1
ID,Type,Name
1699,yum,Red Hat Enterprise Virtualization Agents for RHEL 6 Server (RPMs)

downstream: (6.1.1 with ruby193-rubygem-katello-2.2.0.66-1.el7sat.noarch)

# LANG=en_US.UTF-8 hammer -v -u admin -p changeme --output=csv repository-set list --product="Red Hat Enterprise Linux Server" --name="Red Hat Enterprise Virtualization Agents for RHEL 6 Server (RPMs)" --organization-id=1
ID,Type,Name
1699,yum,Red Hat Enterprise Virtualization Agents for RHEL 6 Server (RPMs)

Comment 6 Og Maciel 2015-10-05 19:35:52 UTC
# hammer -v -u admin -p changeme --output=csv repository-set available-repositories --product="Red Hat Enterprise Linux Server" --name="Red Hat Enterprise Virtualization Agents for RHEL 6 Server (RPMs)" --organization-id=1
Name,Arch,Release,Enabled
Red Hat Enterprise Virtualization Agents for RHEL 6 Server RPMs i386 6.1,i386,6.1,false
Red Hat Enterprise Virtualization Agents for RHEL 6 Server RPMs x86_64 6.1,x86_64,6.1,false
Red Hat Enterprise Virtualization Agents for RHEL 6 Server RPMs i386 6.2,i386,6.2,false
Red Hat Enterprise Virtualization Agents for RHEL 6 Server RPMs x86_64 6.2,x86_64,6.2,false
Red Hat Enterprise Virtualization Agents for RHEL 6 Server RPMs i386 6.3,i386,6.3,false
Red Hat Enterprise Virtualization Agents for RHEL 6 Server RPMs x86_64 6.3,x86_64,6.3,false
Red Hat Enterprise Virtualization Agents for RHEL 6 Server RPMs i386 6.4,i386,6.4,false
Red Hat Enterprise Virtualization Agents for RHEL 6 Server RPMs x86_64 6.4,x86_64,6.4,false
Red Hat Enterprise Virtualization Agents for RHEL 6 Server RPMs i386 6.5,i386,6.5,false
Red Hat Enterprise Virtualization Agents for RHEL 6 Server RPMs x86_64 6.5,x86_64,6.5,false
Red Hat Enterprise Virtualization Agents for RHEL 6 Server RPMs i386 6.6,i386,6.6,false
Red Hat Enterprise Virtualization Agents for RHEL 6 Server RPMs x86_64 6.6,x86_64,6.6,false
Red Hat Enterprise Virtualization Agents for RHEL 6 Server RPMs i386 6.7,i386,6.7,false
Red Hat Enterprise Virtualization Agents for RHEL 6 Server RPMs x86_64 6.7,x86_64,6.7,false
Red Hat Enterprise Virtualization Agents for RHEL 6 Server RPMs i386 6Server,i386,6Server,false
Red Hat Enterprise Virtualization Agents for RHEL 6 Server RPMs x86_64 6Server,x86_64,6Server,false

Comment 7 Og Maciel 2015-10-05 19:36:42 UTC
Verified using a system with Satellite-6.1.0-RHEL-7-20151002.0 compose

Comment 9 errata-xmlrpc 2015-10-15 18:20:09 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-2015:1911