Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1160847 - hammer import config-file doesn't handle rhn.system.net_interface.* macros correctly
hammer import config-file doesn't handle rhn.system.net_interface.* macros co...
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Transitions (Show other bugs)
6.0.5
Unspecified Unspecified
unspecified Severity high (vote)
: Unspecified
: Unused
Assigned To: Grant Gainey
Roman Plevka
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-11-05 14:23 EST by Grant Gainey
Modified: 2017-02-23 15:49 EST (History)
5 users (show)

See Also:
Fixed In Version: rubygem-hammer_cli_import-0.10.6-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-08-12 01:18:44 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:1592 normal SHIPPED_LIVE Important: Red Hat Satellite 6.1.1 on RHEL 6 2015-08-12 05:04:35 EDT

  None (edit)
Description Grant Gainey 2014-11-05 14:23:45 EST
Description of problem:

When converting Sat5 config-files to puppet, the 'hammer import config-file' command is supposed to be able to translate between rhn.system.net_interface.* config-macros and several puppet @ipaddress/netmask_{NETWORK_INTERFACE} facts.

This does not, alas, happen.

How reproducible:

Have a Sat5 with config files that include macros like

rhn.system.net_interface.ip_address(eth0)

and a Sat6 that you want to import those files into as puppet-modules.


Steps to Reproduce:

Sat5: satellite-export
Sat5: scp export to Sat6
Sat6: hammer import config-file --csv-file /somewhere/config-files-latest.csv --generate-only
Examine generated puppet files

Actual results:

<% rhn.system.net_interface.ip_address(eth0) %>

Expected results:

<% @ipaddress_eth0 %>

Additional info:

configfile.rb needs to have a much less brain-dead map_macros function.
Comment 1 RHEL Product and Program Management 2014-11-05 14:43:02 EST
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 Grant Gainey 2014-12-05 16:12:13 EST
katello/hammer-cli-import commit 528e6c5fc265aac38faf85abb03b3b12a713cdef
Comment 6 Roman Plevka 2015-05-18 08:43:57 EDT
VERIFIED

tested on: Satellite-6.1.0-RHEL-7-20150513.0

# 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/sysconfig/rhn/systemid,file,8,1,N,"
sid={| rhn.system.sid |}
profile_name={| rhn.system.profile_name |}
description={| rhn.system.description |}
hostname={| rhn.system.hostname |}
sys_ip_address={| rhn.system.ip_address |}
cust_info={| rhn.system.custom_info(asset) |}
ip_address={| rhn.system.net_interface.ip_address(eth0) |}
netmask={| rhn.system.net_interface.netmask(eth0) |}
broadcast={| rhn.system.net_interface.broadcast(eth0) |}
mac_address={| rhn.system.net_interface.hardware_address(eth0) |}
driver_module={| rhn.system.net_interface.driver_module(eth0) |}
",{|,|},root,root,600,,


# hammer import config-file --generate-only --csv-file config-files-latest.csv
Writing converted files
Summary
  Wrote 1 puppet module.
  Wrote 1 puppet file.

# cat ../puppet_work_dir/redhatsatteamqa-config_1/templates/_etc_sysconfig_rhn_systemid.erb

sid=<%=  %>
profile_name=<%=  %>
description=<%=  %>
hostname=<%= @fqdn %>
sys_ip_address=<%= @ipaddress %>
cust_info=<%= rhn.system.custom_info(asset) %>
ip_address=<%= @ipaddress_eth0 %>
netmask=<%= @netmask_eth0 %>
broadcast=<%=  %>
mac_address=<%= @macaddress_eth0 %>
driver_module=<%=  %>
Comment 7 Bryan Kearney 2015-08-11 09:27:52 EDT
This bug is slated to be released with Satellite 6.1.
Comment 8 errata-xmlrpc 2015-08-12 01:18:44 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2015:1592

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