summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorJames Laska <jlaska@redhat.com>2009-02-19 16:52:17 -0500
committerJames Laska <jlaska@redhat.com>2009-02-20 07:42:26 -0500
commit7c40644c237f98ca7007e38cbaef61bca6929fb5 (patch)
treec51468be7df436bbba37ef65b863f15103c9e9af /templates
parent465ed402306df437b2030795f002e16f4f807b2a (diff)
downloadcobbler-7c40644c237f98ca7007e38cbaef61bca6929fb5.tar.gz
cobbler-7c40644c237f98ca7007e38cbaef61bca6929fb5.tar.xz
cobbler-7c40644c237f98ca7007e38cbaef61bca6929fb5.zip
Fix a few bugs and add several new CMS variables
Diffstat (limited to 'templates')
-rw-r--r--templates/s390x_conf.template50
1 files changed, 27 insertions, 23 deletions
diff --git a/templates/s390x_conf.template b/templates/s390x_conf.template
index 8b659a84..7541ae06 100644
--- a/templates/s390x_conf.template
+++ b/templates/s390x_conf.template
@@ -1,49 +1,52 @@
DASD=100-101,200
SUBCHANNELS=0.0.0600,0.0.0601,0.0.0602
NETTYPE=qeth
+#if $getVar('hostname', '') != ''
+HOSTNAME=$hostname
+#end if
+#if $getVar('name_servers_search', '') != ''
+#echo "SEARCHDNS=%s\n" % ':'.join($name_servers_search)
+#end if
+#if $getVar('gateway', '') != ''
+GATEWAY=$gateway
+#end if
+#if $getVar('name_servers', '') != ''
+#echo "DNS=%s\n" % ':'.join($name_servers)
+#end if
#if $getVar("interfaces","") != "" and $interfaces.has_key("eth0")
- $set $hostname=$interfaces['eth0'].get('hostname','')
#set $ip=$interfaces['eth0'].get('ip_address','')
#set $netmask=$interfaces['eth0'].get('subnet','')
- #set $gateway=$interfaces['eth0'].get('gateway','')
- #set $nameservers=':'.join($interfaces['eth0'].get('nameservers',''))
- #set $dnssearch=':'.join($interfaces['eth0'].get('dnssearch',''))
#if $ip != ''
#set $tokens = $ip.split('.')
#set $tokens = $tokens[0:-1]
- #set $broadcast = " ".join($tokens) + ".255"
+ #set $broadcast = ".".join($tokens) + ".255"
#else
#set $broadcast = ""
#end if
#else
- #set $hostname=""
#set $ip=""
#set $netmask=""
- #set $gateway=""
- #set $nameservers=""
- #set $dnssearch=""
#set $broadcast = ""
#end if
-#if $hostname != ''
-HOSTNAME=$hostname
-#end if
#if $ip != ''
IPADDR=$ip
#end if
-## FIXME: don't know what to do with this?
-## NETWORK=192.168.5.0
+## Unless provided, calculate the network using netmask and broadcast
+#if $getVar('network', '') != ''
+NETWORK=$network
+#elif $netmask != '' and $ip != ''
+#set $ip_split = $ip.split('.')
+#set $nm_split = $netmask.split('.')
+#set $nw_split = []
+#for $oct in $range($len($ip_split))
+#silent $nw_split.append("%s" % ($int($nm_split[$oct]) & $int($ip_split[$oct])))
+#end for
+#set $network=".".join($nw_split)
+NETWORK=$network
+#end if
#if $netmask != ''
NETMASK=$netmask
#end if
-#if $dnssearch != ''
-SEARCHDNS=$dnssearch
-#end if
-#if $gateway != ''
-GATEWAY=$gateway
-#end if
-#if $nameservers != ''
-DNS=$name_servers
-#end if
## FIXME: the hack that generates this assumes ip with 255 as last octet
## FIXME: if this is wrong, don't change here, change at the top where it's set
#if $broadcast != ''
@@ -51,4 +54,5 @@ BROADCAST=$broadcast
#end if
MTU=1500
PORTNAME=UNASSIGNED
+PORTNO=0
LAYER2=0