Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1160847

Summary: hammer import config-file doesn't handle rhn.system.net_interface.* macros correctly
Product: Red Hat Satellite Reporter: Grant Gainey <ggainey>
Component: TransitionsAssignee: Grant Gainey <ggainey>
Status: CLOSED ERRATA QA Contact: Roman Plevka <rplevka>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.0.5CC: bbuckingham, cperry, cwelton, ggainey, rplevka
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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 05:18:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Grant Gainey 2014-11-05 19:23:45 UTC
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 Program Management 2014-11-05 19:43: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 Grant Gainey 2014-12-05 21:12:13 UTC
katello/hammer-cli-import commit 528e6c5fc265aac38faf85abb03b3b12a713cdef

Comment 6 Roman Plevka 2015-05-18 12:43:57 UTC
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 13:27:52 UTC
This bug is slated to be released with Satellite 6.1.

Comment 8 errata-xmlrpc 2015-08-12 05:18:44 UTC
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