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.
Description of problem: When importing users (with no role-mapping file), import subcommand wants to log message "Role-mapping file ... not found, no roles will be assigned". This causes following traceback
NoMethodError (undefined method `log' for nil:NilClass):
./lib/hammer_cli_import/importtools.rb:220:in `log'
./lib/hammer_cli_import/importtools.rb:208:in `warn'
./lib/hammer_cli_import/user.rb:54: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.1.1/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:67:in `run'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/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:67:in `run'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22: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.1.1/bin/hammer:102
/usr/bin/hammer:19:in `load'
/usr/bin/hammer:19
How reproducible: always/deterministic
Steps to Reproduce:
1. either run subcommand without installation
(RUBYOPT=-Ilib hammer ....) or remove mapping file.
RUBYOPT=-Ilib hammer -v import user --debug --csv-file /tmp/exports/users.csv --new-passwords newpws.csv
Actual results: program terminates with mentioned traceback.
Expected results: ...
Additional info:
@logger is initialized in execute method. However, loading mapping file/checking stuff
is done in execute as well, and super is called only after this test.
Proposed solutions
* move logger initialization into init (probably preferred as otherwise
we would need to check other places where we override exec and this
might cause complications in the future)
* move mapping file checking/loading somewhere else
Comment 1RHEL Program Management
2014-07-22 09:53:41 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.
Moving logging-setup into init is a non-starter, because it relies on knowing the setting of the --debug option, and options aren't processed until after init :(
However, we fixed the issues that caused this BZ to be opened, by deciding to stop overriding execute().
See commit 610fc67318ba2501c531fbedec2b54be1ea6cd98 for 'removing execute overrides'
See commit 16d4cd6d68ad62c42b0981a05eefa83af9057471 for 'putting setup_logging back where it belongs'
Description of problem: When importing users (with no role-mapping file), import subcommand wants to log message "Role-mapping file ... not found, no roles will be assigned". This causes following traceback NoMethodError (undefined method `log' for nil:NilClass): ./lib/hammer_cli_import/importtools.rb:220:in `log' ./lib/hammer_cli_import/importtools.rb:208:in `warn' ./lib/hammer_cli_import/user.rb:54: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.1.1/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:67:in `run' /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/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:67:in `run' /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22: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.1.1/bin/hammer:102 /usr/bin/hammer:19:in `load' /usr/bin/hammer:19 How reproducible: always/deterministic Steps to Reproduce: 1. either run subcommand without installation (RUBYOPT=-Ilib hammer ....) or remove mapping file. RUBYOPT=-Ilib hammer -v import user --debug --csv-file /tmp/exports/users.csv --new-passwords newpws.csv Actual results: program terminates with mentioned traceback. Expected results: ... Additional info: @logger is initialized in execute method. However, loading mapping file/checking stuff is done in execute as well, and super is called only after this test. Proposed solutions * move logger initialization into init (probably preferred as otherwise we would need to check other places where we override exec and this might cause complications in the future) * move mapping file checking/loading somewhere else