With this commit applied, I get the following error when trying to
render snippets/post_install_network_config_deb as invoked by
sample.preseed:
Thu Aug 28 16:34:19 2014 - INFO | generate_script
Thu Aug 28 16:34:19 2014 - ERROR |
# *** ERROR ***
#
# There is a templating error preventing this file from rendering correctly.
#
# This is most likely not due to a bug in Cobbler and is something you can fix.
#
# Look at the message below to see what things are causing problems.
#
# (1) Does the template file reference a $variable that is not defined?
# (2) is there a formatting error in a Cheetah directive?
# (3) Should dollar signs ($) be escaped that are not being escaped?
#
# Try fixing the problem and then investigate to see if this message goes
# away or changes.
#
#
# need more than 1 value to unpack
# File "/usr/lib/python2.7/site-packages/cobbler/templar.py", line 204, in render_cheetah
# data_out = t.respond()
#
# File "cheetah_DynamicallyCompiledCheetahTemplate_1409261659_45_92467.py", line 127, in respond
#
# File "cheetah_DynamicallyCompiledCheetahTemplate_1409261659_45_92467.py", line 70, in __errorCatcher1
#
# File "<string>", line 1, in <module>
#
# File "/usr/lib/python2.7/site-packages/cobbler/template_api.py", line 173, in SNIPPET
# result = BuiltinTemplate.SNIPPET(self, file)
#
# File "DynamicallyCompiledCheetahTemplate.py", line 88, in SNIPPET
#
# File "/usr/lib64/python2.7/site-packages/Cheetah/Template.py", line 1615, in _handleCheetahInclude
# self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
#
# File "cheetah_DynamicallyCompiledCheetahTemplate_1409261659_65_55359.py", line 438, in respond
#
Thu Aug 28 16:34:19 2014 - INFO | Exception occured: <class 'cobbler.cexceptions.CX'>
Thu Aug 28 16:34:19 2014 - INFO | Exception value: 'Error templating file, check cobbler.log for more details'
Thu Aug 28 16:34:19 2014 - INFO | Exception Info:
File "/usr/lib/python2.7/site-packages/cobbler/remote.py", line 2154, in _dispatch
return method_handle(*params)
File "/usr/lib/python2.7/site-packages/cobbler/remote.py", line 1121, in generate_script
return self.api.generate_script(profile, system, name)
File "/usr/lib/python2.7/site-packages/cobbler/api.py", line 701, in generate_script
return self.pxegen.generate_script("system", system, name)
File "/usr/lib/python2.7/site-packages/cobbler/pxegen.py", line 1102, in generate_script
return self.templar.render(template_data, blended, None, obj)
File "/usr/lib/python2.7/site-packages/cobbler/templar.py", line 112, in render
data_out = self.render_cheetah(raw_data, search_table, subject)
File "/usr/lib/python2.7/site-packages/cobbler/templar.py", line 211, in render_cheetah
raise CX("Error templating file, check cobbler.log for more details")
The following changes let the templating succeed:
diff --git a/snippets/post_install_network_config b/snippets/post_install_network_config
index 2b0e57c..8dcced7 100644
--- a/snippets/post_install_network_config
+++ b/snippets/post_install_network_config
@@ -173,7 +173,7 @@ cat >> $devfile << EOF
BONDING_OPTS="$bonding_opts"
EOF
#end if
- #elif $iface_type in ("bond_slave") and $iface_master != ""
+ #elif $iface_type == "bond_slave" and $iface_master != ""
echo "SLAVE=yes" >> $devfile
echo "MASTER=$iface_master" >> $devfile
echo "HOTPLUG=no" >> $devfile
diff --git a/snippets/post_install_network_config_deb b/snippets/post_install_network_config_deb
index c135ecb..697a3dd 100644
--- a/snippets/post_install_network_config_deb
+++ b/snippets/post_install_network_config_deb
@@ -97,7 +97,7 @@ echo "auto $iname" >> /etc/network/interfaces
## ===================================================================
#if $iface_type in ("bond","bonded_bridge_slave")
#pass
- #elif $iface_type in ("bond_slave") and $iface_master != ""
+ #elif $iface_type == "bond_slave" and $iface_master != ""
#pass
#elif $iface_type == "bridge"
#set $slave_ports = " ".join($bridge_slaves.get($iname,[]))
@@ -124,7 +124,7 @@ echo " netmask $netmask" >> /etc/network/interfaces
echo " mtu $mtu" >> /etc/network/interfaces
#end if
#end if
- #if $ip == "" and $iface_type in ("bond") and $is_vlan == "false"
+ #if $ip == "" and $iface_type == "bond" and $is_vlan == "false"
echo "iface $iname inet manual" >> /etc/network/interfaces
#set $bondslaves = ""
#for $bondiname in $ikeys
@@ -156,7 +156,7 @@ echo " mtu $mtu" >> /etc/network/interfaces
#if $netmask != ""
echo " netmask $netmask" >> /etc/network/interfaces
#end if
- #if $iface_type in ("bond")
+ #if $iface_type == "bond"
#set $bondslaves = ""
#for $bondiname in $ikeys
#set $bondidata = $interfaces[$bondiname]
@@ -177,7 +177,7 @@ echo " bond-$bondkey $bondvalue" >> /etc/network/interfaces
echo "iface $iname inet manual" >> /etc/network/interfaces
#end if
#end if
- #if $iface_type in ("bond_slave") and $iface_master != ""
+ #if $iface_type == "bond_slave" and $iface_master != ""
echo "bond-master $iface_master" >> /etc/network/interfaces
#end if
#if $enableipv6 == True and $ipv6_autoconfiguration == False
Thanks,
Nish