Red Hat Bugzilla – Bug 1198245
Command hammer --version fails (for discovery module)
Last modified: 2017-02-23 15:24:13 EST
Description of problem: hammer --version fails with undefined method `version' for HammerCLIForemanDiscovery:Module. This time the error is caused by foreman_discovery module. Version-Release number of selected component (if applicable): Satellite-6.1.0-RHEL-6-20150302.0 rubygem-hammer_cli_foreman_discovery-0.0.1.2-1.el6_6sat.noarch rubygem-hammer_cli_foreman-0.1.4.6-1.el6_6sat.noarch rubygem-hammer_cli-0.1.4.3-1.el6_6sat.noarch How reproducible: 100'/. Steps to Reproduce: 0. Currently the other modules have issues with version method too - we need to enable only related module(s), disable the others: # sed -i 's|true|false|' /etc/hammer/cli.modules.d/*.yml # sed -i 's|false|true|' /etc/hammer/cli.modules.d/foreman{,_discovery}.yml 1.# hammer --version hammer (0.1.4) * hammer_cli_foreman (0.1.4.6) Error: undefined method `version' for HammerCLIForemanDiscovery:Module Actual results: fails with an error Expected results: shows module versions
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.
We should include this fix in the next rebase as well, Ori. Can you investigate please?
*** Bug 1201686 has been marked as a duplicate of this bug. ***
The version is actually defined in the code so it should be just matter of requiring 'version.rb' from the top plugin file.
Moving to POST since upstream bug http://projects.theforeman.org/issues/9746 has been closed ------------- Dominic Cleal Applied in changeset commit:hammer-discovery|890b2af80448c238193ff7b614fe46184e7adddb.
Tested against Satellite-6.1.0-RHEL-6-20150324.0 and Satellite-6.1.0-RHEL-7-20150324.0: # cd /etc/hammer/cli.modules.d/ # grep -i 'enable_module' *.yml | column -t foreman_bootdisk.yml: :enable_module: true foreman_discovery.yml: :enable_module: true foreman.yml: :enable_module: true gutterball.yml: :enable_module: true import.yml: :enable_module: true katello.yml: :enable_module: true # sed -i -e 's/enable_module: true/enable_module: false/' *.yml # sed -i -e 's/enable_module: false/enable_module: true/' foreman{,_discovery}.yml # hammer --version hammer (0.1.4.8) * hammer_cli_foreman (0.1.4.7) * hammer_cli_foreman_discovery (0.0.1.4) # sed -i -e 's/enable_module: false/enable_module: true/' *.yml # hammer --version hammer (0.1.4.8) * hammer_cli_foreman (0.1.4.7) * hammer_cli_foreman_bootdisk (0.1.2.5) * hammer_cli_foreman_discovery (0.0.1.4) * hammer_cli_gutterball (unknown version) * hammer_cli_import (0.10.6.3) * hammer_cli_katello (0.0.7.5)
This bug is slated to be released with Satellite 6.1.
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