Hammer CLI Import: Issueshttps://projects.theforeman.org/https://projects.theforeman.org/favicon.ico?16970236342018-04-19T02:49:06ZForeman
Redmine Bug #23323 (Closed): As a hammer user I would like to see "skipped contents" information in a repohttps://projects.theforeman.org/issues/233232018-04-19T02:49:06ZPartha Ajipaji@redhat.com
<p><a class="external" href="http://projects.theforeman.org/issues/22803">http://projects.theforeman.org/issues/22803</a> will provide the ability to skip content in a repo like srpms, drpms, erratum etc.</p>
<p>We would like hammer repository info call to display this information.</p> Bug #17589 (Closed): Unable to import, first import content view with id https://projects.theforeman.org/issues/175892016-12-06T10:27:36ZAdam Priceadprice@redhat.com
<p>Cloned from <a class="external" href="https://bugzilla.redhat.com/show_bug.cgi?id=1168964">https://bugzilla.redhat.com/show_bug.cgi?id=1168964</a></p>
<p>Description of problem:</p>
<p>when trying to import system profiles with hammer I get the following error:</p>
<p>Import content-host with arguments --csv-file /tmp/exports/system-profiles.csv --export-directory /root/rpm-working-dir Unable to import, first import content view with id 102 Unable to import</p>
<p>How reproducible:</p>
<p>Steps to Reproduce:</p>
<p>1. install satellite 6 on rhel 6.6<br />2. on satellite 5.6 machine run spacewalk-export --entities users,system-profiles<br />3. # mkdir -p /tmp/exports<br />4. # chgrp -R apache /tmp/exports/ # chmod -R 0750 /tmp/exports/<br />5. # hammer import all --directory=/tmp/exports</p>
<p>Actual results:<br />Unable to import, first import content view with id 102 Unable to import, first import content view with id 102 Unable to import, first import content view with id 102 Unable to import, first import content view with id 102 Unable to import, first import content view with id 102 Unable to import, first import content view with id 102 Summary No</p>
<p>Expected results:<br />orgs to import or come back with a message why they didnt import</p>
<p>Additional info: mine shows up with 144, so i am assuming the number is based on the system profile or something of that nature</p> Bug #16558 (Closed): hammer_cli_import fails to load with hammer_cli_katello-0.1.0https://projects.theforeman.org/issues/165582016-09-14T10:34:25ZStephen Benjaminstephen@redhat.com
<p>hammer_cli_import needs compatability with 0.1.0 and a new release with the correct versions in the rpm spec.</p>
<p>hammer_cli_import causes errors in hammer:</p>
<pre>
Warning: An error occured while loading module hammer_cli_import
</pre>
<p>The reason is because of this:<br /> [ERROR 2016-09-14 10:30:16 Modules] <Gem::LoadError> Could not find 'hammer_cli_katello' (~> 0.0.6) - did find: [hammer_cli_katello-0.1.0]</p> Bug #14970 (Closed): Lifecycle environment is searched for multiple times when given as a name.https://projects.theforeman.org/issues/149702016-05-09T10:19:39ZZach Huntington-Meathzhunting@redhat.com
<p>The Katello API is being called multiple times when searching for a lifecycle environment name. The EnvironmentName resolver and LifecyclEnvironmentName resolver can be changed to have it only be called once.</p> Bug #14616 (Closed): hammer import config-file on RHEL7 fails to generate puppet moduleshttps://projects.theforeman.org/issues/146162016-04-13T10:49:20ZThomas McKaythomasmckay@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/146152016-04-13T10:48:12ZThomas McKaythomasmckay@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>