Bug 1134506 - hammer import activation-key fails with NoMethodError:undefined method `each' for nil:NilClass while post_import
Summary: hammer import activation-key fails with NoMethodError:undefined method `each'...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Transitions
Version: Unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: Unspecified
Assignee: Matej Kollar
QA Contact: Lukas Pramuk
URL:
Whiteboard:
Depends On:
Blocks: stargate-GA-tracker
TreeView+ depends on / blocked
 
Reported: 2014-08-27 16:11 UTC by Lukas Pramuk
Modified: 2017-02-23 21:01 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-01 12:27:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Lukas Pramuk 2014-08-27 16:11:31 UTC
Description of problem:
hammer import activation-key fails with NoMethodError:undefined method `each' for nil:NilClass while post_import when importing from an empty csv file.
And only post_import phase is affected.

Version-Release number of selected component (if applicable):
rubygem-hammer_cli_import-0.10.2-1.el6.noarch

How reproducible:
100%

Steps to Reproduce:
0. prepare an empty activation-keys.csv with just header there 
1. # hammer import activation-key  --verbose --csv-file /tmp/exports/activation-keys.csv
Importing from /tmp/exports/activation-keys.csv
Caught NoMethodError:undefined method `each' for nil:NilClass while post_import
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.2/lib/hammer_cli_import/activationkey.rb:104:in `post_import'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.2/lib/hammer_cli_import/base.rb:515:in `execute'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.2/lib/hammer_cli_import/importtools.rb:295:in `call'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.2/lib/hammer_cli_import/importtools.rb:295:in `handle_missing_and_supress'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.2/lib/hammer_cli_import/base.rb:514: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
Summary
  No action taken.

Actual results:
shown traceback

Expected results:
no traceback

Comment 1 RHEL Program Management 2014-08-27 16:13:05 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 Tomas Lestach 2014-08-28 15:00:56 UTC
This looks to be fixed by ...

hammer-cli-import.git: 1feb7de251166208de5456dbf6a3ed1ceea72b19

Comment 4 Matej Kollar 2014-08-28 15:05:09 UTC
Yes, that should fix that.

Comment 6 Grant Gainey 2014-09-04 18:15:42 UTC
DEVELOPER VERIFIED:

===
~/tests $ cat 1134506_empty_ak.csv 
org_id,token,note,usage_limit,is_disabled,deploys_configs,entitlement,channel_label,base_channel_id,child_channel_id,cfg_channel_pos,server_group,server_group_id,package_name
~/tests $ hammer import activation-key --csv-file 1134506_empty_ak.csv 
Summary
  No action taken.
~/tests $

I, [2014-09-04T14:13:33.026250 #25569]  INFO -- : Importing from 1134506_empty_ak.csv
I, [2014-09-04T14:13:33.027401 #25569]  INFO -- : Summary
I, [2014-09-04T14:13:33.027624 #25569]  INFO -- :   No action taken.
===

Verified on 0.10.4

Comment 7 Grant Gainey 2014-10-01 12:27:14 UTC
Released as part of Sat 6.0 GA


Note You need to log in before you can comment on or make changes to this bug.