Project

General

Profile

Bug #14616

hammer import config-file on RHEL7 fails to generate puppet modules

Added by Thomas McKay about 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1325880
Description of problem:
hammer import config-file on RHEL7 fails to generate puppet modules.
It uses "puppet module generate <name>" and on RHEL7 it fails to parse command interview questions at all, while on RHEL6 command output with interview questions is parsed successfully.

Version-Release number of selected component (if applicable):
@Sat6.2.0-Beta-Snap
tfm-rubygem-hammer_cli_import-0.10.23-1.el7sat.noarch

How reproducible:
always on RHEL7

Steps to Reproduce:
1. # cat users.csv
organization_id,organization,user_id,username,last_name,first_name,position,email,role,creation_time,last_login_time,active
1,SatelliteQE,1,admin,Admin,Admin,,root@localhost,Satellite Administrator,2014-09-10 19:39:59,2016-04-07 01:00:14,enabled

2. # hammer import organization --verbose --csv-file users.csv
Importing from users.csv
Creating new organization: SatelliteQE
Summary
Created 1 organization.

3. # cat config-files-latest.csv
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,3,config-1,normal,/etc/config1,file,3,2,N,config1 file ver.2,{|,|},apache,apache,0,,

4. # hammer import config-file --debug --csv-file config-files-latest.csv --generate-only
Importing from config-files-latest.csv
Caught EOFError:end of file reached while processing CSV line: {"org_id"=>"1", "channel_id"=>"3", "channel"=>"config-1", "channel_type"=>"normal", "path"=>"/etc/config1", "file_type"=>"file", "file_id"=>"3", "revision"=>"2", "is_binary"=>"N", "contents"=>"config1 file ver.2", "delim_start"=>"{|", "delim_end"=>"|}", "username"=>"apache", "groupname"=>"apache", "filemode"=>"0", "symbolic_link"=>nil, "selinux_ctx"=>nil}
Writing converted files
Found module satelliteqe-config_1
Caught Errno::ENOENT:No such file or directory @ dir_s_mkdir - /root/puppet_work_dir/satelliteqe-config_1/files while post_import
Summary
No action taken.

5. # less import.log:
...
I, [2016-04-11T08:03:46.664346 #17137] INFO -- : Importing from config-files-latest.csv
D, [2016-04-11T08:03:46.665697 #17137] DEBUG -- : Removing /root/puppet_work_dir/satelliteqe-config_1
E, [2016-04-11T08:03:47.255283 #17137] ERROR -- : Caught EOFError:end of file reached while processing CSV line: {"org_id"=>"1", "channel_id"=>"3", "channel"=>"config-1", "channel_type"=>"normal", "path"=>"/etc/config1", "file_type"=>"file", "file_id"=>"3", "revision"=>"2", "is_binary"=>"N", "contents"=>"config1 file ver.2", "delim_start"=>"{|", "delim_end"=>"|}", "username"=>"apache", "groupname"=>"apache", "filemode"=>"0", "symbolic_link"=>nil, "selinux_ctx"=>nil}
E, [2016-04-11T08:03:47.255556 #17137] ERROR -- : /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/configfile.rb:146:in `readline'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/configfile.rb:146:in `block (2 levels) in generate_module_template_for'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/configfile.rb:143:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/configfile.rb:143:in `block in generate_module_template_for'
/opt/rh/rh-ruby22/root/usr/share/ruby/open3.rb:199:in `popen_run'
/opt/rh/rh-ruby22/root/usr/share/ruby/open3.rb:93:in `popen3'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/configfile.rb:141:in `generate_module_template_for'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/configfile.rb:193:in `generate_module'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/configfile.rb:251:in `import_single_row'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/base.rb:527:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/base.rb:527:in `block (2 levels) in cvs_iterate'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/importtools.rb:324:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/importtools.rb:324:in `handle_missing_and_supress'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/base.rb:526:in `block in cvs_iterate'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/csvhelper.rb:55:in `block in csv_each'
/opt/rh/rh-ruby22/root/usr/share/ruby/csv.rb:1739:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/csvhelper.rb:44:in `csv_each'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/base.rb:525:in `cvs_iterate'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/base.rb:533:in `import'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/base.rb:569:in `execute'

Actual results:
fails to generate a puppet module (afterwards it is uploaded)

Expected results:
generates a puppet module successfully (to be then uploaded onto server)

Associated revisions

Revision d3b04f42 (diff)
Added by Thomas McKay almost 3 years ago

fixes #14616 - correct handling of EOF error

Revision e4f075e0
Added by Thomas McKay almost 3 years ago

Merge pull request #27 from thomasmckay/14616-puppet

fixes #14616 - correct handling of EOF error

Revision 71b7fe72 (diff)
Added by Eric D Helms almost 3 years ago

Refs #14616: Use clean bash environment to shell out for puppet (#29)

History

#1 Updated by Thomas McKay about 3 years ago

  • Project changed from Katello to Hammer CLI Import

#2 Updated by Thomas McKay almost 3 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF