Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1162799 - Cannot add a puppet module to a content view by name
Cannot add a puppet module to a content view by name
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Hammer (Show other bugs)
Nightly
Unspecified Unspecified
unspecified Severity medium (vote)
: Unspecified
: Unused
Assigned To: David Davis
Kedar Bidarkar
http://projects.theforeman.org/issues...
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-11-11 12:35 EST by Elyézer Rezende
Modified: 2017-02-23 15:49 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-08-12 01:19:03 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 8583 None None None 2016-04-22 12:06 EDT
Red Hat Product Errata RHSA-2015:1592 normal SHIPPED_LIVE Important: Red Hat Satellite 6.1.1 on RHEL 6 2015-08-12 05:04:35 EDT

  None (edit)
Description Elyézer Rezende 2014-11-11 12:35:06 EST
Description of problem:
Trying to add a puppet module to a content view by name fails while using the puppet module id works. 


Version-Release number of selected component (if applicable):
hammer (0.1.3)
 * hammer_cli_import (0.10.4)
 * hammer_cli_katello (0.0.6)
 * hammer_cli_foreman (0.1.3)

How reproducible:
Aways


Steps to Reproduce:
1. Create a repository and synchronize it
2. Create a content view
3. List the puppet modules and choose one
4. Try to add a puppet module to a content view by its name

Actual results:
The command fail with the following error message:

Error: content_view_puppet_module not found
Could not add the puppet module:
  Error: content_view_puppet_module not found

Expected results:
The puppet module added to the content view


Additional info:

Adding by name
--------------

# LANG=en_US.UTF-8 hammer -v -u admin -p changeme  --output csv puppet-module list --repository-id='157'
ID,Name,Author,Version
81b2c255-22db-48ba-951d-b48bbf2e374c,pureftpd,5UbZ3r0,1.0.2
b3d6fcdd-72ba-4ca4-a5f3-763b4223f5dd,cron,5UbZ3r0,0.0.1
bd89d01d-84fd-4075-8771-2d8260a50153,ntp,puppetlabs,3.2.1
04d60c64-30b7-4138-9e6a-ee30eb23b221,samba,5UbZ3r0,0.2.0
378e4b76-0f90-4986-bc6f-c13dd2047f05,httpd,5UbZ3r0,0.2.0

# LANG=en_US.UTF-8 hammer -v -u admin -p changeme  --output csv content-view puppet-module add --content-view-id='305' --name='samba'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/lib/hammer_cli/./apipie/../abstract.rb:67: warning: already initialized constant DEFAULT_LABEL_INDENT
[ERROR 2014-11-11 12:21:34 Exception] Error: content_view_puppet_module not found
Could not add the puppet module:
  Error: content_view_puppet_module not found
[ERROR 2014-11-11 12:21:34 Exception]

HammerCLIForeman::ResolverError (content_view_puppet_module not found):
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.3/lib/hammer_cli_foreman/id_resolver.rb:140:in `pick_result'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.3/lib/hammer_cli_foreman/id_resolver.rb:136:in `find_resource'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.3/lib/hammer_cli_foreman/id_resolver.rb:114:in `get_id'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.3/lib/hammer_cli_foreman/id_resolver.rb:108:in `content_view_puppet_module_id'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.3/lib/hammer_cli_foreman/commands.rb:143:in `send'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.3/lib/hammer_cli_foreman/commands.rb:143:in `get_resource_id'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.3/lib/hammer_cli_foreman/commands.rb:132:in `get_identifier'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.3/lib/hammer_cli_foreman/commands.rb:180:in `customized_options'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.3/lib/hammer_cli_foreman/commands.rb:185:in `request_params'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_katello-0.0.6/lib/hammer_cli_katello/content_view_puppet_module.rb:35:in `request_params'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/lib/hammer_cli/./apipie/command.rb:42:in `send_request'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.3/lib/hammer_cli_foreman/commands.rb:164:in `send_request'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/lib/hammer_cli/./apipie/command.rb:33:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:68:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/lib/hammer_cli/./apipie/../abstract.rb:22: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:68:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/lib/hammer_cli/./apipie/../abstract.rb:22: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:68:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/lib/hammer_cli/./apipie/../abstract.rb:22: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:68:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/lib/hammer_cli/./apipie/../abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:126:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/bin/hammer:106
    /usr/bin/hammer:19:in `load'
    /usr/bin/hammer:19

Adding by ID
------------

# LANG=en_US.UTF-8 hammer -v -u admin -p changeme  --output csv puppet-module list --repository-id='159'
ID,Name,Author,Version
81b2c255-22db-48ba-951d-b48bbf2e374c,pureftpd,5UbZ3r0,1.0.2
b3d6fcdd-72ba-4ca4-a5f3-763b4223f5dd,cron,5UbZ3r0,0.0.1
bd89d01d-84fd-4075-8771-2d8260a50153,ntp,puppetlabs,3.2.1
04d60c64-30b7-4138-9e6a-ee30eb23b221,samba,5UbZ3r0,0.2.0
378e4b76-0f90-4986-bc6f-c13dd2047f05,httpd,5UbZ3r0,0.2.0

# LANG=en_US.UTF-8 hammer -v -u admin -p changeme  --output csv content-view puppet-module add --content-view-id='309' --id='81b2c255-22db-48ba-951d-b48bbf2e374c'
Message,Id,Name
Puppet module added to content view,5,pureftpd
Comment 2 Partha Aji 2014-12-04 10:50:41 EST
Created redmine issue http://projects.theforeman.org/issues/8583 from this bug
Comment 3 Bryan Kearney 2015-01-14 20:04:44 EST
Moving to POST since upstream bug http://projects.theforeman.org/issues/8583 has been closed
-------------
David Davis
Applied in changeset commit:hammer-cli-katello|d08b9834dd43a58104d34311ad485f50649686c1.
Comment 6 Kedar Bidarkar 2015-02-13 06:44:49 EST
[root@xxxx puppet_module]# hammer -u admin -p changeme content-view puppet-module add --content-view-id=6 --name samba
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.4/lib/hammer_cli/./apipie/../abstract.rb:68: warning: already initialized constant DEFAULT_LABEL_INDENT
Puppet module added to content view


[root@xxxx puppet_module]# hammer -u admin -p changeme content-view list --organization-id 1
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.4/lib/hammer_cli/./apipie/../abstract.rb:68: warning: already initialized constant DEFAULT_LABEL_INDENT
----------------|---------------------------|---------------------------|-----------|---------------
CONTENT VIEW ID | NAME                      | LABEL                     | COMPOSITE | REPOSITORY IDS
----------------|---------------------------|---------------------------|-----------|---------------
1               | Default Organization View | Default_Organization_View |           |
5               | docker_cv                 | docker_cv                 |           | 12
3               | example_cv                | example_cv                |           | 2
6               | puppet2_cv                | puppet2_cv                |           |
4               | puppet_repo               | puppet_repo               |           |
2               | rhel66_cv                 | rhel66_cv                 |           | 2, 1
----------------|---------------------------|---------------------------|-----------|---------------




[root@xxxx puppet_module]# hammer -u admin -p changeme content-view info --id 6 --organization-id 1
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.4/lib/hammer_cli/./apipie/../abstract.rb:68: warning: already initialized constant DEFAULT_LABEL_INDENT
ID:                     6
Name:                   puppet2_cv
Label:                  puppet2_cv
Composite:
Description:
Content Host Count:     0
Organization:           Default Organization
Yum Repositories:

Docker Repositories:

Puppet Modules:
 1) ID:      3
    Name:    samba
    Author:  5UbZ3r0
    Created: 2015/02/13 11:42:12
    Updated: 2015/02/13 11:42:12


VERIFIED with sat6.1-Beta-SNAP1
Comment 7 Kedar Bidarkar 2015-02-13 06:45:58 EST
update: VERIFIED with sat6.1-Beta-SNAP2
Comment 8 Bryan Kearney 2015-08-11 09:22:26 EDT
This bug is slated to be released with Satellite 6.1.
Comment 9 errata-xmlrpc 2015-08-12 01:19:03 EDT
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-2015:1592

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