Bug 1109313
| Summary: | hammer lifecycle-environment list with a not created --name is not working | ||
|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | Elyézer Rezende <erezende> |
| Component: | Hammer | Assignee: | Martin Bacovsky <mbacovsk> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | sthirugn <sthirugn> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 6.0.3 | CC: | bbuckingham, jmontleo, mbacovsk, sthirugn |
| Target Milestone: | Unspecified | Keywords: | Regression, Reopened, Triaged |
| Target Release: | Unused | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| URL: | http://projects.theforeman.org/issues/6238 | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2014-07-02 14:14:37 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: | |||
CSV adapter is failing on printing empty collections. Created redmine issue http://projects.theforeman.org/issues/6238 from this bug Fixed upstream https://github.com/theforeman/hammer-cli/pull/119 Verified. # hammer --output csv lifecycle-environment list --name='nonexisting' --organization-id=1 ID,Name,Prior # hammer lifecycle-environment list --name='nonexisting' --organization-id=1No data. Version Tested: * 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.18-1.el6sat.noarch * foreman-compute-1.6.0.18-1.el6sat.noarch * foreman-gce-1.6.0.18-1.el6sat.noarch * foreman-libvirt-1.6.0.18-1.el6sat.noarch * foreman-ovirt-1.6.0.18-1.el6sat.noarch * foreman-postgresql-1.6.0.18-1.el6sat.noarch * foreman-proxy-1.6.0.8-1.el6sat.noarch * foreman-selinux-1.6.0-4.el6sat.noarch * foreman-vmware-1.6.0.18-1.el6sat.noarch * katello-1.5.0-26.el6sat.noarch * katello-ca-1.0-1.noarch * katello-certs-tools-1.5.5-1.el6sat.noarch * katello-installer-0.0.49-1.el6sat.noarch * openldap-2.4.23-32.el6_4.1.x86_64 * openldap-devel-2.4.23-32.el6_4.1.x86_64 * pulp-katello-0.3-3.el6sat.noarch * pulp-nodes-common-2.4.0-0.21.beta.el6sat.noarch * pulp-nodes-parent-2.4.0-0.21.beta.el6sat.noarch * pulp-puppet-plugins-2.4.0-0.21.beta.el6sat.noarch * pulp-puppet-tools-2.4.0-0.21.beta.el6sat.noarch * pulp-rpm-plugins-2.4.0-0.21.beta.el6sat.noarch * pulp-selinux-2.4.0-0.21.beta.el6sat.noarch * pulp-server-2.4.0-0.21.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 This was delivered with 6.0.3, which is the Satellite 6 Beta. This was delivered in 6.0.3, the Beta version of Satellite 6.0 This was delivered in the Satellite 6 Beta (6.0.3) |
Description of problem: Hammer is raising an exception when trying to list passing a --name of a lifecycle environment that was not created or have been deleted. The error is not raised when passing a --name of a created lifecycle environment. Version-Release number of selected component (if applicable): # hammer --version hammer (0.1.1) * hammer_cli_foreman (0.1.1) * hammer_cli_katello (0.0.4) How reproducible: Aways Steps to Reproduce: 1. LANG=en_US hammer -v -u admin -p changeme --output csv lifecycle-environment list --name=<not_created_name> --organization-id=<org_id> Actual results: Error "Error: undefined method `map' for nil:NilClass" is raised Expected results: Return a list with no result Additional info: # LANG=en_US hammer -v -d -u admin -p changeme --output csv lifecycle-environment list --name='q2h09tnk' --organization-id='224' [ INFO 2014-06-13 10:20:07 Init] Initialization of Hammer CLI (0.1.1) has started... [DEBUG 2014-06-13 10:20:07 Init] Running at ruby 1.8.7-p352 [ INFO 2014-06-13 10:20:07 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded [ INFO 2014-06-13 10:20:07 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded [ INFO 2014-06-13 10:20:07 Init] Configuration from the file /etc/hammer/cli.modules.d/katello.yml has been loaded [DEBUG 2014-06-13 10:20:07 Connection] Registered: foreman [DEBUG 2014-06-13 10:20:07 API] Global headers: { "Accept-Language" => "en", :accept => "application/json;version=2", :content_type => "application/json" } [ INFO 2014-06-13 10:20:07 API] GET /apidoc/apipie_checksum [DEBUG 2014-06-13 10:20:07 API] Params: {} [DEBUG 2014-06-13 10:20:07 API] Headers: { :accept => "application/json", :params => {} } [DEBUG 2014-06-13 10:20:07 API] Response { "checksum" => "c1ab9a17632a976fd006a97155bdfbbe" } [ INFO 2014-06-13 10:20:08 Modules] Extension module hammer_cli_foreman (0.1.1) loaded [ INFO 2014-06-13 10:20:08 HammerCLI::MainCommand] subcommand organization (HammerCLIForeman::Organization) was removed. [ INFO 2014-06-13 10:20:08 HammerCLI::MainCommand] subcommand organization (HammerCLIKatello::Organization) was created. [ INFO 2014-06-13 10:20:09 Modules] Extension module hammer_cli_katello (0.0.4) loaded [DEBUG 2014-06-13 10:20:09 Init] Using locale 'en' [DEBUG 2014-06-13 10:20:09 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/locale' [DEBUG 2014-06-13 10:20:09 Init] 'mo' files for locale domain 'hammer-cli-foreman' loaded from '/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/locale' [DEBUG 2014-06-13 10:20:09 Init] 'mo' files for locale domain 'hammer-cli-katello' loaded from '/usr/lib/ruby/gems/1.8/gems/hammer_cli_katello-0.0.4/locale' [ INFO 2014-06-13 10:20:09 HammerCLI::MainCommand] Called with options: {"option_verbose"=>true, "option_username"=>"admin", "option_password"=>"***", "option_debug"=>true, "option_output"=>"csv"} [ INFO 2014-06-13 10:20:09 HammerCLIKatello::LifecycleEnvironmentCommand] Called with options: {} [ INFO 2014-06-13 10:20:09 HammerCLIKatello::LifecycleEnvironmentCommand::ListCommand] Called with options: {"option_name"=>"q2h09tnk", "option_organization_id"=>"224"} [ INFO 2014-06-13 10:20:09 API] GET /apidoc/apipie_checksum [DEBUG 2014-06-13 10:20:09 API] Params: {} [DEBUG 2014-06-13 10:20:09 API] Headers: { :accept => "application/json", :params => {} } [DEBUG 2014-06-13 10:20:09 API] Response { "checksum" => "c1ab9a17632a976fd006a97155bdfbbe" } [ INFO 2014-06-13 10:20:09 API] GET /katello/api/organizations/224/environments [DEBUG 2014-06-13 10:20:09 API] Params: { "name" => "q2h09tnk" } [DEBUG 2014-06-13 10:20:09 API] Headers: { :params => { "name" => "q2h09tnk" } } [DEBUG 2014-06-13 10:20:09 API] Response { "sort" => { "order" => nil, "by" => nil }, "per_page" => 20, "results" => [], "total" => 0, "page" => 1, "search" => nil, "subtotal" => 0 } [ERROR 2014-06-13 10:20:09 Exception] Error: undefined method `map' for nil:NilClass Error: undefined method `map' for nil:NilClass [ERROR 2014-06-13 10:20:09 Exception] NoMethodError (undefined method `map' for nil:NilClass): /usr/lib/ruby/gems/1.8/gems/fastercsv-1.5.4/lib/faster_csv.rb:1490:in `<<' /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/output/adapter/csv.rb:155:in `print_collection' /usr/lib/ruby/gems/1.8/gems/fastercsv-1.5.4/lib/faster_csv.rb:1077:in `generate' /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/output/adapter/csv.rb:194:in `generate' /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/output/adapter/csv.rb:154:in `print_collection' /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/output/output.rb:27:in `print_collection' /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:166:in `print_collection' /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:57:in `print_data' /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:234:in `retrieve_and_print' /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:207: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:100 /usr/bin/hammer:19:in `load' /usr/bin/hammer:19