Bug 1134576 - hammer import config-file fails with NoMethodError:private method `gsub' called for nil:NilClass
Summary: hammer import config-file fails with NoMethodError:private method `gsub' call...
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: Tomas Lestach
QA Contact: Lukas Pramuk
URL:
Whiteboard:
Depends On:
Blocks: stargate-GA-tracker
TreeView+ depends on / blocked
 
Reported: 2014-08-27 20:18 UTC by Lukas Pramuk
Modified: 2017-02-23 21:01 UTC (History)
3 users (show)

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


Attachments (Terms of Use)

Description Lukas Pramuk 2014-08-27 20:18:38 UTC
Description of problem:
hammer import config-file fails with NoMethodError:private method `gsub' called for nil:NilClass when importing config file that has no content (empty file).

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 config-files-latest.csv which lists a file with empty content (column contents):
org_id,channel_id,channel,channel_type,path,file_type,file_id,revision,is_binary,contents,delim_start,delim_end,username,groupname,filemode,symbolic_link,selinux_ctx
1,30,test02,normal,/tmp/sadfghjkl,file,344,2,N,,{|,|},bin,root,646,,root:object_r:tmp_t

1. # hammer import config-file --verbose --csv-file /tmp/exports/config-files-latest.csv
Importing from /tmp/exports/config-files-latest.csv
Caught NoMethodError:private method `gsub' called for nil:NilClass while processing CSV line:
{"contents"=>nil, "channel"=>"test02", "channel_id"=>"30", "symbolic_link"=>nil, "groupname"=>"root", "username"=>"bin", "file_type"=>"file", "channel_type"=>"normal", "delim_end"=>"|}", "delim_start"=>"{|", "filemode"=>"646", "org_id"=>"1", "file_id"=>"344", "path"=>"/tmp/sadfghjkl", "selinux_ctx"=>"root:object_r:tmp_t", "is_binary"=>"N", "revision"=>"2"}
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.2/lib/hammer_cli_import/configfile.rb:185:in `file_data'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.2/lib/hammer_cli_import/configfile.rb:222:in `import_single_row'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.2/lib/hammer_cli_import/base.rb:471:in `call'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.2/lib/hammer_cli_import/base.rb:471:in `cvs_iterate'
/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:470:in `cvs_iterate'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.2/lib/hammer_cli_import/csvhelper.rb:52:in `csv_each'
/usr/lib/ruby/gems/1.8/gems/fastercsv-1.5.4/lib/faster_csv.rb:1545:in `each'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.2/lib/hammer_cli_import/csvhelper.rb:43:in `csv_each'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.2/lib/hammer_cli_import/base.rb:469:in `cvs_iterate'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.2/lib/hammer_cli_import/base.rb:477:in `import'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.10.2/lib/hammer_cli_import/base.rb:513: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
  Created 4 puppet_files.
  Created 27 puppet_modules.


Actual results:
traceback

Expected results:
no traceback, file is imported

Comment 1 RHEL Program Management 2014-08-27 20:33:02 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 14:57:21 UTC
hammer-cli-import.git: 4edd9d5b27c620686f01683e3e2d39847455b6fc

Comment 5 Matej Kollar 2014-09-03 13:26:49 UTC
verified with rubygem-hammer_cli_import-0.10.4-1

Comment 6 Grant Gainey 2014-10-01 12:27:12 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.