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 1089905

Summary: Hammer CLI: Undefined method error while adding/listing puppet modules to content-view
Product: Red Hat Satellite Reporter: Sachin Ghai <sghai>
Component: HammerAssignee: Tomas Strachota <tstrachota>
Status: CLOSED CURRENTRELEASE QA Contact: sthirugn <sthirugn>
Severity: high Docs Contact:
Priority: unspecified    
Version: NightlyCC: akrzos, bbuckingham, bkearney, jmontleo, mmccune, omaciel, sthirugn
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/5958
Whiteboard:
Fixed In Version: Doc Type: Release Note
Doc Text:
Puppet modules should be added using the UI, not using the hammer command line tool.
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-11 12:29:56 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:
Attachments:
Description Flags
complete stack trace from production.log none

Description Sachin Ghai 2014-04-22 08:14:18 UTC
Description of problem:

While adding the puppet module to selected cv, I got following error:
Could not add the puppet module:
  undefined method `version' for nil:NilClass

And re-adding the same module, I got this error:
Could not add the puppet module:
  Validation failed: Name has already been taken

Example:
==========
[root@dhcp201-107 ~]# hammer puppet-module list --repository-id 28
-------------------------------------|----------|---------|--------
ID                                   | NAME     | VERSION | AUTHOR 
-------------------------------------|----------|---------|--------
0fc2dbcd-4cbf-41af-9d30-8b1aae5c33a2 | httpd    | 0.2.0   | 5UbZ3r0
a99ac26f-86b1-4c21-9039-2ff8db766c12 | cron     | 0.0.1   | 5UbZ3r0
c11a583b-371b-41d9-9485-0d3eea7dbe98 | pureftpd | 1.0.2   | 5UbZ3r0
c536af58-8739-48f0-8f17-1c152851771a | samba    | 0.2.0   | 5UbZ3r0
-------------------------------------|----------|---------|--------

]# hammer content-view puppet-module add --name httpd --content-view-id 4
Could not add the puppet module:
  undefined method `version' for nil:NilClass
# hammer content-view puppet-module add --name httpd --content-view-id 4
Could not add the puppet module:
  Validation failed: Name has already been taken



[root@dhcp201-107 ~]# hammer content-view puppet-module list --content-view-id 4undefined method `version' for nil:NilClass
[root@dhcp201-107 ~]# 




Version-Release number of selected component (if applicable):
* apr-util-ldap-1.3.9-3.el6_0.1.x86_64
* candlepin-0.9.9-1.el6.noarch
* candlepin-selinux-0.9.9-1.el6.noarch
* candlepin-tomcat6-0.9.9-1.el6.noarch
* elasticsearch-0.90.10-4.el6.noarch
* foreman-1.5.0-0.develop.201404131512git070b83f.el6.noarch
* foreman-postgresql-1.5.0-0.develop.201404131512git070b83f.el6.noarch
* foreman-proxy-1.5.0-0.develop.201404101114git85098a3.el6.noarch
* foreman-release-1.5.0-0.develop.201404131512git070b83f.el6.noarch
* foreman-selinux-1.5.0-0.develop.201402261344git2f43f94.el6.noarch
* katello-1.5.0-14.201404131508git84cd57d.el6.noarch
* katello-apache-1.0-1.noarch
* katello-ca-1.0-1.noarch
* katello-certs-tools-1.5.2-1.git.1.edab2c4.el6.noarch
* katello-installer-0.0.19-1.201404021805git6ac0e9a.el6.noarch
* katello-repos-1.5.1-1.git.14.0868bd1.el6.noarch
* openldap-2.4.23-32.el6_4.1.x86_64
* pulp-katello-plugins-0.2-1.el6.noarch
* pulp-nodes-common-2.3.1-1.el6.noarch
* pulp-nodes-parent-2.3.1-1.el6.noarch
* pulp-puppet-plugins-2.3.1-1.el6.noarch
* pulp-rpm-plugins-2.3.1-1.el6.noarch
* pulp-selinux-2.3.1-1.el6.noarch
* pulp-server-2.3.1-1.el6.noarch
* python-ldap-2.3.10-1.el6.x86_64
* ruby193-rubygem-ldap_fluff-0.2.2-2.el6.noarch
* ruby193-rubygem-net-ldap-0.3.1-1.el6.noarch
* ruby193-rubygem-runcible-1.0.8-1.el6.noarch
* rubygem-hammer_cli-0.1.0-1.201404090839gitc07a987.git.0.9acea1c.el6.noarch
* rubygem-hammer_cli_foreman-0.1.0-1.201404011518git2abbfd3.git.0.37211af.el6.noarch
* rubygem-hammer_cli_foreman_tasks-0.0.2-1.201403312028gitdf60592.git.0.b4ebd5a.el6.noarch
* rubygem-hammer_cli_katello-0.0.3-1.201404131527gitfb2a029.git.0.7153de9.el6.noarch


How reproducible:
always 


Actual results:
undefined method error on adding/listing puppet modules to cv. 

Expected results:
module should be added successfully

Additional info:

Comment 1 Sachin Ghai 2014-04-22 08:15:14 UTC
Created attachment 888380 [details]
complete stack trace from production.log

Comment 2 RHEL Program Management 2014-04-22 08:24:38 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 4 Brad Buckingham 2014-05-27 18:34:05 UTC
Created redmine issue http://projects.theforeman.org/issues/5958 from this bug

Comment 5 Alex Krzos 2014-07-15 17:26:13 UTC
Ran into the same issue on the beta-bits (Snap11-Compose3).

As a work around for this, you can use the --author option.  That appears to be working.

#hammer content-view puppet-module add --content-view-id 90 --name rabbitmq --author=puppetlabs
# hammer content-view puppet-module list --content-view-id 90
---|------|----------|-----------
ID | UUID | NAME     | AUTHOR
---|------|----------|-----------
5  |      | rabbitmq | puppetlabs
---|------|----------|-----------

Comment 7 sthirugn@redhat.com 2014-08-07 17:10:02 UTC
Verified.

hammer> content-view puppet-module add --name motd --content-view-id=3
Puppet module added to content view

hammer> content-view puppet-module list --content-view-id=3
---|------|------|------------|------------------------
ID | UUID | NAME | AUTHOR     | VERSION                
---|------|------|------------|------------------------
4  |      | motd | jeffmccune | Latest(Currently 1.0.3)
---|------|------|------------|------------------------


Version Tested:
GA Snap 4 - Satellite-6.0.4-RHEL-6-20140806.0

* apr-util-ldap-1.3.9-3.el6_0.1.x86_64
* candlepin-0.9.19-1.el6_5.noarch
* candlepin-scl-1-5.el6_4.noarch
* candlepin-scl-quartz-2.1.5-5.el6_4.noarch
* candlepin-scl-rhino-1.7R3-1.el6_4.noarch
* candlepin-scl-runtime-1-5.el6_4.noarch
* candlepin-selinux-0.9.19-1.el6_5.noarch
* candlepin-tomcat6-0.9.19-1.el6_5.noarch
* elasticsearch-0.90.10-4.el6sat.noarch
* foreman-1.6.0.38-1.el6sat.noarch
* foreman-compute-1.6.0.38-1.el6sat.noarch
* foreman-gce-1.6.0.38-1.el6sat.noarch
* foreman-libvirt-1.6.0.38-1.el6sat.noarch
* foreman-ovirt-1.6.0.38-1.el6sat.noarch
* foreman-postgresql-1.6.0.38-1.el6sat.noarch
* foreman-proxy-1.6.0.23-1.el6sat.noarch
* foreman-selinux-1.6.0.4-1.el6sat.noarch
* foreman-vmware-1.6.0.38-1.el6sat.noarch
* katello-1.5.0-28.el6sat.noarch
* katello-ca-1.0-1.noarch
* katello-certs-tools-1.5.6-1.el6sat.noarch
* katello-installer-0.0.57-1.el6sat.noarch
* openldap-2.4.23-34.el6_5.1.x86_64
* pulp-katello-0.3-3.el6sat.noarch
* pulp-nodes-common-2.4.0-0.30.beta.el6sat.noarch
* pulp-nodes-parent-2.4.0-0.30.beta.el6sat.noarch
* pulp-puppet-plugins-2.4.0-0.30.beta.el6sat.noarch
* pulp-puppet-tools-2.4.0-0.30.beta.el6sat.noarch
* pulp-rpm-plugins-2.4.0-0.30.beta.el6sat.noarch
* pulp-selinux-2.4.0-0.30.beta.el6sat.noarch
* pulp-server-2.4.0-0.30.beta.el6sat.noarch
* python-ldap-2.3.10-1.el6.x86_64
* ruby193-rubygem-net-ldap-0.3.1-3.el6sat.noarch
* ruby193-rubygem-runcible-1.1.0-2.el6sat.noarch
* sssd-ldap-1.11.5.1-3.el6.x86_64

Comment 9 Bryan Kearney 2014-09-11 12:29:56 UTC
This was delivered with Satellite 6.0 which was released on 10 September 2014.