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 1079386

Summary: Forman CLI configuration file is outdated
Product: Red Hat Satellite Reporter: Og Maciel <omaciel>
Component: InstallationAssignee: Martin Bacovsky <mbacovsk>
Status: CLOSED CURRENTRELEASE QA Contact: Tazim Kolhar <tkolhar>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 6.0.3CC: adprice, bkearney, cwelton, erezende, mbacovsk, omaciel, tkolhar
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-02 14:07:48 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
foreman-debug output from nightly 2014-03-24 03:00 (GMT-3) installation
none
hammer debug output from nightly 2014-03-24 03:00 (GMT-3) installation none

Description Og Maciel 2014-03-21 14:08:31 UTC
Description of problem:

Looks like upstream nightly CLI configuration file is outdated

Current
-------

:modules:
  - hammer_cli_foreman
  - hammer_cli_katello

:foreman:
    :host: 'https://localhost/'
    :username: 'admin'
    :password: 'changeme'

:log_dir: '~/.foreman/log'
:log_level: 'error'
:log_api_calls: false

Based on https://github.com/theforeman/hammer-cli/blob/master/doc/installation.md the configuration file should have a different syntax

Supposedly Correct
------------------

:modules:
  - hammer_cli_foreman
  - hammer_cli_katello

:katello:
    :enable_plugin: true
    :host: 'https://localhost/'
    :username: 'admin'
    :password: 'changeme'

:foreman:
    :enable_plugin: true
    :host: 'https://localhost/'
    :username: 'admin'
    :password: 'changeme'

:log_dir: '~/.foreman/log'
:log_level: 'error'
:log_api_calls: false


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

* apr-util-ldap-1.3.9-3.el6_0.1.x86_64
* candlepin-0.8.33-1.el6.noarch
* candlepin-selinux-0.8.33-1.el6.noarch
* candlepin-tomcat6-0.8.33-1.el6.noarch
* elasticsearch-0.90.10-4.el6.noarch
* foreman-1.5.0-0.develop.201403201806git9e0d8a4.el6.noarch
* foreman-postgresql-1.5.0-0.develop.201403201806git9e0d8a4.el6.noarch
* foreman-proxy-1.5.0-0.develop.201403141615git2f75941.el6.noarch
* foreman-release-1.5.0-0.develop.201403201806git9e0d8a4.el6.noarch
* foreman-selinux-1.5.0-0.develop.201402261344git2f43f94.el6.noarch
* katello-1.5.0-14.201403201852git6244c45.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.201403201300gitf0e4024.el6.noarch
* katello-repos-1.5.1-1.git.14.0868bd1.el6.noarch
* openldap-2.4.23-31.el6.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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

[ERROR 2014-03-21 09:08:19 Modules] Module hammer_cli_katello_bridge not found
[root@qetello01 ~]# vim /etc/foreman/cli_config.yml
[root@qetello01 ~]# hammer -v | grep gpg
[ERROR 2014-03-21 09:08:54 Modules] Error while loading module hammer_cli_katello
[ERROR 2014-03-21 09:08:54 Modules] <NameError> uninitialized constant HammerCLIForeman::ReadCommand
	/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman_tasks-0.0.1/lib/hammer_cli_foreman_tasks/task.rb:3
	/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
	/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
	/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman_tasks-0.0.1/lib/hammer_cli_foreman_tasks.rb:5
	/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
	/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
	/usr/lib/ruby/gems/1.8/gems/hammer_cli_katello-0.0.3/lib/hammer_cli_katello.rb:6
	/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
	/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
	/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/modules.rb:47:in `require_module'
	/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/modules.rb:24:in `load!'
	/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/modules.rb:41:in `load'
	/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/modules.rb:52:in `load_all'
	/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/modules.rb:51:in `each'
	/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/modules.rb:51:in `load_all'
	/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/bin/hammer:54
	/usr/bin/hammer:19:in `load'
	/usr/bin/hammer:19

Comment 1 RHEL Program Management 2014-03-21 14:15:06 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 3 Martin Bacovsky 2014-03-24 09:41:38 UTC
Thanks for the report. Some of the issues were already addressed, But due to some issues with nightlies workflow didn't get to the repos yet.

From what I can see in your report:

Correct config
--------------
:katello:
    :enable_plugin: true

:foreman:
    :enable_plugin: true
    :host: 'https://localhost/'
    :username: 'admin'
    :password: 'changeme'

:log_dir: '~/.foreman/log'
:log_level: 'error'
:log_api_calls: false

But the proper config should be fixed in the new packages.

From "[ERROR 2014-03-21 09:08:19 Modules] Module hammer_cli_katello_bridge not found" I can assume that there is some other config file somewhere,trying to add hammer_cli_katello_bridge module, that was removed from the repos as it does not make sense to have it there. It would be usefull to add full hammer log as an attachment. In the start of the log you can see what config files were processed.

In the second part (in the traceback) Hammer looks for HammerCLIForeman::ReadCOmmand which suggest the hhammer_cli_foreman was not loaded due to some errors, that also be visible form the logs. 

I'll try to reproduce setup you have. But please attach full log if you have it.

Comment 4 Elyézer Rezende 2014-03-24 14:04:20 UTC
Update based on last nightly installation at about 3am (GMT-3)

# cat /etc/foreman/cli_config.yml
:modules:
  - hammer_cli_foreman
  - hammer_cli_katello

:foreman:
    :host: 'https://localhost/'
    :username: 'admin'
    :password: 'changeme'

:log_dir: '~/.foreman/log'
:log_level: 'error'
:log_api_calls: false

And when trying to run hammer with -v flag:

# hammer -v
[ERROR 2014-03-24 10:02:20 Modules] Error while loading module hammer_cli_katello
[ERROR 2014-03-24 10:02:20 Modules] <NameError> uninitialized constant HammerCLIForeman::ReadCommand
	/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman_tasks-0.0.1/lib/hammer_cli_foreman_tasks/task.rb:3
	/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
	/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
	/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman_tasks-0.0.1/lib/hammer_cli_foreman_tasks.rb:5
	/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
	/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
	/usr/lib/ruby/gems/1.8/gems/hammer_cli_katello-0.0.3/lib/hammer_cli_katello.rb:6
	/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
	/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
	/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/modules.rb:47:in `require_module'
	/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/modules.rb:24:in `load!'
	/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/modules.rb:41:in `load'
	/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/modules.rb:52:in `load_all'
	/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/modules.rb:51:in `each'
	/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/modules.rb:51:in `load_all'
	/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/bin/hammer:54
	/usr/bin/hammer:19:in `load'
	/usr/bin/hammer:19
Warning: An error occured while loading module hammer_cli_katello
[usage output removed]

Comment 5 Elyézer Rezende 2014-03-24 14:14:03 UTC
Created attachment 878080 [details]
foreman-debug output from nightly 2014-03-24 03:00 (GMT-3) installation

Comment 6 Martin Bacovsky 2014-03-24 14:37:18 UTC
Thanks for the logs. Could you please also attach full hammer output in debug mode (In /etc/foreman/cli_config.yml 'log_level: 'debug')?

Comment 7 Elyézer Rezende 2014-03-24 14:49:39 UTC
Created attachment 878090 [details]
hammer debug output from nightly 2014-03-24 03:00 (GMT-3) installation

Comment 8 Bryan Kearney 2014-03-30 21:01:22 UTC
Adam.. I think this is fixed now.. yes?

Comment 9 Adam Price 2014-05-08 20:19:35 UTC
yes should be

Comment 10 Tazim Kolhar 2014-05-19 08:10:18 UTC
# pwd
/etc/foreman


# ls
client_ca.pem    client_key.pem  email.yaml         plugins
client_cert.pem  database.yml    encryption_key.rb  settings.yaml

# hammer -v | grep gpg
    gpg                           manipulate GPG Key actions on the server

Comment 11 Bryan Kearney 2014-07-02 14:07:48 UTC
This was delivered with 6.0.3, which is the Satellite 6 Beta.