Hammer CLI Import: Issues
https://projects.theforeman.org/
https://projects.theforeman.org/favicon.ico?1697023634
2016-04-13T10:49:20Z
Foreman
Redmine
Bug #14616 (Closed): hammer import config-file on RHEL7 fails to generate puppet modules
https://projects.theforeman.org/issues/14616
2016-04-13T10:49:20Z
Thomas McKay
thomasmckay@redhat.com
<p>Cloned from <a class="external" href="https://bugzilla.redhat.com/show_bug.cgi?id=1325880">https://bugzilla.redhat.com/show_bug.cgi?id=1325880</a> <br /> Description of problem:<br />hammer import config-file on RHEL7 fails to generate puppet modules.<br />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.</p>
<p>Version-Release number of selected component (if applicable):<br />@Sat6.2.0-Beta-Snap<br />tfm-rubygem-hammer_cli_import-0.10.23-1.el7sat.noarch</p>
<p>How reproducible:<br />always on RHEL7</p>
<p>Steps to Reproduce:<br />1. # cat users.csv <br />organization_id,organization,user_id,username,last_name,first_name,position,email,role,creation_time,last_login_time,active<br />1,SatelliteQE,1,admin,Admin,Admin,,root@localhost,Satellite Administrator,2014-09-10 19:39:59,2016-04-07 01:00:14,enabled</p>
<p>2. # hammer import organization --verbose --csv-file users.csv <br />Importing from users.csv<br />Creating new organization: SatelliteQE<br />Summary<br /> Created 1 organization.</p>
<p>3. # cat config-files-latest.csv <br />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<br />1,3,config-1,normal,/etc/config1,file,3,2,N,config1 file ver.2,{|,|},apache,apache,0,,</p>
<p>4. # hammer import config-file --debug --csv-file config-files-latest.csv --generate-only<br />Importing from config-files-latest.csv<br />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}<br />Writing converted files<br />Found module satelliteqe-config_1<br />Caught Errno::ENOENT:No such file or directory @ dir_s_mkdir - /root/puppet_work_dir/satelliteqe-config_1/files while post_import<br />Summary<br /> No action taken.</p>
<p>5. # less import.log:<br />...<br />I, [2016-04-11T08:03:46.664346 <a class="issue tracker-1 status-3 priority-4 priority-default closed" title="Bug: installer text recommends 'rpm -e' instead of 'yum erase', resulting in error (Resolved)" href="https://projects.theforeman.org/issues/17137">#17137</a>] INFO -- : Importing from config-files-latest.csv<br />D, [2016-04-11T08:03:46.665697 <a class="issue tracker-1 status-3 priority-4 priority-default closed" title="Bug: installer text recommends 'rpm -e' instead of 'yum erase', resulting in error (Resolved)" href="https://projects.theforeman.org/issues/17137">#17137</a>] DEBUG -- : Removing /root/puppet_work_dir/satelliteqe-config_1<br />E, [2016-04-11T08:03:47.255283 <a class="issue tracker-1 status-3 priority-4 priority-default closed" title="Bug: installer text recommends 'rpm -e' instead of 'yum erase', resulting in error (Resolved)" href="https://projects.theforeman.org/issues/17137">#17137</a>] 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}<br />E, [2016-04-11T08:03:47.255556 <a class="issue tracker-1 status-3 priority-4 priority-default closed" title="Bug: installer text recommends 'rpm -e' instead of 'yum erase', resulting in error (Resolved)" href="https://projects.theforeman.org/issues/17137">#17137</a>] ERROR -- : /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/configfile.rb:146:in `readline'<br />/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'<br />/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/configfile.rb:143:in `each'<br />/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'<br />/opt/rh/rh-ruby22/root/usr/share/ruby/open3.rb:199:in `popen_run'<br />/opt/rh/rh-ruby22/root/usr/share/ruby/open3.rb:93:in `popen3'<br />/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'<br />/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/configfile.rb:193:in `generate_module'<br />/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'<br />/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/base.rb:527:in `call'<br />/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'<br />/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/importtools.rb:324:in `call'<br />/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'<br />/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'<br />/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'<br />/opt/rh/rh-ruby22/root/usr/share/ruby/csv.rb:1739:in `each'<br />/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/csvhelper.rb:44:in `csv_each'<br />/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/base.rb:525:in `cvs_iterate'<br />/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/base.rb:533:in `import'<br />/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/base.rb:569:in `execute'</p>
<p>Actual results:<br />fails to generate a puppet module (afterwards it is uploaded)</p>
<p>Expected results:<br />generates a puppet module successfully (to be then uploaded onto server)</p>
Bug #14615 (Closed): hammer import content-host fails with ISE - Content View and Environment not...
https://projects.theforeman.org/issues/14615
2016-04-13T10:48:12Z
Thomas McKay
thomasmckay@redhat.com
<p>Cloned from <a class="external" href="https://bugzilla.redhat.com/show_bug.cgi?id=1325497">https://bugzilla.redhat.com/show_bug.cgi?id=1325497</a> <br /> Description of problem:<br />hammer import content-host fails with ISE - Content View and Environment not set for registration. No content-host are being created.</p>
<p>Version-Release number of selected component (if applicable):<br />@Sat6.2.0-Beta-Snap6.2<br />tfm-rubygem-hammer_cli_import-0.10.23-1.el7sat.noarch</p>
<p>How reproducible:<br />always</p>
<p>Steps to Reproduce:<br />1. # cat users.csv <br />organization_id,organization,user_id,username,last_name,first_name,position,email,role,creation_time,last_login_time,active<br />1,SatelliteQE,1,admin,Admin,Admin,,root@localhost,Satellite Administrator,2014-09-10 19:39:59,2016-04-07 01:00:14,enabled</p>
<p>2. # hammer import organization --verbose --csv-file users.csv <br />Importing from users.csv<br />Creating new organization: SatelliteQE<br />Summary<br /> Created 1 organization.</p>
<p>3. # cat system-profiles.csv <br />server_id,profile_name,hostname,description,organization_id,organization_name,base_channel_id,base_channel_label,child_channel_id,child_channel_label,system_group_id,system_group,release,architecture,virtual_host,virtual_guest,is_virtualized,virt_type<br />1000010009,profile1,tyan-gt24-01.example.com,,1,Red Hat SatTeam QA,,,,,,,7Server,x86_64,,,No,</p>
<p>4. # hammer -d import content-host --verbose --csv-file system-profiles.csv --export-directory .<br />...<br />Importing from system-profiles.csv<br />Creating new system: profile1<br />[ INFO 2016-04-09 11:25:42 API] POST /katello/api/systems<br />[DEBUG 2016-04-09 11:25:42 API] Params: {<br /> :name => "profile1",<br /> :description => "\nsat5_system_id: 1000010009",<br /> :facts => {<br /> "release" => "7Server",<br /> "architecture" => "x86_64" <br /> },<br /> :type => "system",<br /> :organization_id => 8,<br /> :content_view_id => nil,<br /> :host_collection_ids => []<br />}<br />[DEBUG 2016-04-09 11:25:42 API] Headers: {}<br />[DEBUG 2016-04-09 11:25:43 API] 500 Internal Server Error
{<br /> "displayMessage" => "Content View and Environment not set for registration.",<br /> "errors" => [<br /> [0] "Content View and Environment not set for registration." <br /> ]<br />}<br />Caught RestClient::InternalServerError:500 Internal Server Error while processing CSV line:
{"server_id"=>"1000010009", "profile_name"=>"profile1", "hostname"=>"tyan-gt24-01.example.com", "description"=>nil, "organization_id"=>"1", "base_channel_id"=>nil, "base_channel_label"=>nil, "child_channel_id"=>nil, "system_group_id"=>nil, "release"=>"7Server", "architecture"=>"x86_64", "virtual_host"=>nil, "virtual_guest"=>nil}<br />Summary<br /> No action taken.</p>
<p>Actual results:<br />ISE, no content-host is created</p>
<p>Expected results:<br />content-hosts are successfully created</p>
Bug #14614 (Rejected): hammer import activation-key fails to create composite CVs
https://projects.theforeman.org/issues/14614
2016-04-13T10:45:45Z
Thomas McKay
thomasmckay@redhat.com
<p>Cloned from <a class="external" href="https://bugzilla.redhat.com/show_bug.cgi?id=1325124">https://bugzilla.redhat.com/show_bug.cgi?id=1325124</a> <br /> Description of problem:<br />hammer import activation-key fails to create composite CVs. Import activation-key used to use imported CVs and create composite CV out of them (=grouping base and child channel based CVs togheter).<br />But CV import was broken for sometime so that broken ability to create a composite CV during AK import cannot be simply revealed till now as BZ #1316110 has been fixed.</p>
<p>Version-Release number of selected component (if applicable):<br />@Sat6.2.0-Beta-Snap6.2<br />tfm-rubygem-hammer_cli_import-0.10.23-1.el6sat.noarch</p>
<p>How reproducible:<br />always</p>
<p>Steps to Reproduce:<br />0. Import a organization and upload manifest (manually)</p>
<p>1. Run import repository-enable for RH repositories (manually) and sync 'em (rhel-x86_64-server-7 + rhn-tools-rhel-x86_64-server-7)</p>
2. Prepare csv file for AK import
<ol>
<li>cat activation-keys.csv<br />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<br />1,1-key,None,,0,N,enterprise_entitled;monitoring_entitled;provisioning_entitled,rhel-x86_64-server-7;rhn-tools-rhel-x86_64-server-7,103;None,None;106,config-1|1,,,</li>
</ol>
3. Run AK import
<ol>
<li>hammer import activation-key --verbose --csv-file activation-keys.csv<br />Importing from activation-keys.csv<br />Creating new activation key: 1-key<br />Creating new ak content view: ak_1<br />Caught RestClient::InternalServerError:500 Internal Server Error while processing activation key 1<br />Summary<br /> Created 1 activation_key.</li>
</ol>
<p>Actual results:<br />500 ISE, composite CV not created</p>
<p>Expected results:<br />composite CV successfully created</p>
<p>Additional info:<br />the error message is the same as with BZ #1316110 - undefined method `composite?' for nil:NilClass</p>
Bug #14550 (Rejected): hammer import uses obsolete systems api
https://projects.theforeman.org/issues/14550
2016-04-08T09:13:49Z
Thomas McKay
thomasmckay@redhat.com
<p>hammer import no longer works for creating content hosts since the removal of systems api</p>