"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "snippets/pre_install_network_config" between
cobbler-2.8.4.tar.gz and cobbler-3.0.0.tar.gz

About: cobbler is a Linux installation and deployment server that allows for rapid setup of network installation environments. It can help with installation, DNS, DHCP, package updates, power management, configuration management orchestration, and much more.

pre_install_network_config  (cobbler-2.8.4):pre_install_network_config  (cobbler-3.0.0)
skipping to change at line 42 skipping to change at line 42
#set ikeys = $interfaces.keys() #set ikeys = $interfaces.keys()
#import re #import re
#set $vlanpattern = $re.compile("[a-zA-Z0-9]+[\.][0-9]+") #set $vlanpattern = $re.compile("[a-zA-Z0-9]+[\.][0-9]+")
#set $routepattern = $re.compile("[0-9/.]+:[0-9.]+") #set $routepattern = $re.compile("[0-9/.]+:[0-9.]+")
## ##
## Determine if we should use the MAC address to configure the interfaces fi rst ## Determine if we should use the MAC address to configure the interfaces fi rst
## Only physical interfaces are required to have a MAC address ## Only physical interfaces are required to have a MAC address
#set $configbymac = True #set $configbymac = True
#for $iname in $ikeys #for $iname in $ikeys
#set $idata = $interfaces[$iname] #set $idata = $interfaces[$iname]
#if $idata["mac_address"] == "" and not $vlanpattern.match($iname) and n ## Ignore BMC interface
ot $idata["interface_type"].lower() in ("master","bond","bridge","bonded_bridge_ #if $idata["interface_type"].lower() == "bmc"
slave") #continue
#end if
#if $idata["mac_address"] == "" and not $vlanpattern.match($iname) and n
ot $idata["interface_type"].lower() in ("bond","bridge","bonded_bridge_slave")
#set $configbymac = False #set $configbymac = False
#end if #end if
#end for #end for
#set $i = 0 #set $i = 0
#if $configbymac #if $configbymac
## Output diagnostic message ## Output diagnostic message
# Start of code to match cobbler system interfaces to physical interfaces by the ir mac addresses # Start of code to match cobbler system interfaces to physical interfaces by the ir mac addresses
#end if #end if
#for $iname in $ikeys #for $iname in $ikeys
# Start $iname # Start $iname
#set $idata = $interfaces[$iname] #set $idata = $interfaces[$iname]
#set $mac = $idata["mac_address"] #set $mac = $idata["mac_address"]
#set $static = $idata["static"] #set $static = $idata["static"]
#set $ip = $idata["ip_address"] #set $ip = $idata["ip_address"]
#set $netmask = $idata["netmask"] #set $netmask = $idata["netmask"]
#set $gateway = $idata["gateway"]
#set $if_gateway = $idata["if_gateway"] #set $if_gateway = $idata["if_gateway"]
#set $iface_type = $idata["interface_type"] #set $iface_type = $idata["interface_type"]
#set $iface_master = $idata["interface_master"] #set $iface_master = $idata["interface_master"]
#set $static_routes = $idata["static_routes"] #set $static_routes = $idata["static_routes"]
#set $devfile = "/etc/sysconfig/network-scripts/ifcfg-" + $iname #set $devfile = "/etc/sysconfig/network-scripts/ifcfg-" + $iname
#if $vlanpattern.match($iname) #if $vlanpattern.match($iname)
## If this is a VLAN interface, skip it, anaconda doesn't know ## If this is a VLAN interface, skip it, anaconda doesn't know
## about VLANs. ## about VLANs.
#set $is_vlan = "true" #set $is_vlan = "true"
#else #else
#set $is_vlan = "false" #set $is_vlan = "false"
#end if #end if
#if ($configbymac and $is_vlan == "false" and $iface_type.lower() not in ## Ignore BMC interface
("slave","bond_slave","bridge_slave","bonded_bridge_slave")) or $iface_type.low #if $iface_type.lower() == "bmc"
er() in ("master","bond","bridge") #continue
#end if
#if ($configbymac and $is_vlan == "false" and $iface_type.lower() not in
("bond_slave","bridge_slave","bonded_bridge_slave")) or $iface_type.lower() in
("bond","bridge")
## This is a physical interface, hand it to anaconda. Do not ## This is a physical interface, hand it to anaconda. Do not
## process slave interface here. ## process slave interface here.
#if $iface_type.lower() in ("master","bond","bridge","bonded_bridge_ slave") #if $iface_type.lower() in ("bond","bridge","bonded_bridge_slave")
## Find a slave for this interface ## Find a slave for this interface
#for $tiname in $ikeys #for $tiname in $ikeys
#set $tidata = $interfaces[$tiname] #set $tidata = $interfaces[$tiname]
#if $tidata["interface_type"].lower() in ("slave","bond_slav e","bridge_slave") and $tidata["interface_master"].lower() == $iname #if $tidata["interface_type"].lower() in ("bond_slave","brid ge_slave") and $tidata["interface_master"].lower() == $iname
#if $tidata["mac_address"] != '': #if $tidata["mac_address"] != '':
#set $mac = $tidata["mac_address"] #set $mac = $tidata["mac_address"]
# Found a slave for this interface: $tiname ($mac) # Found a slave for this interface: $tiname ($mac)
#break #break
#end if #end if
#else if $tidata["interface_type"].lower() == "bonded_bridge _slave" and $tidata["interface_master"].lower() == $iname #else if $tidata["interface_type"].lower() == "bonded_bridge _slave" and $tidata["interface_master"].lower() == $iname
## find a slave for this slave interface... ## find a slave for this slave interface...
#for $stiname in $ikeys #for $stiname in $ikeys
#set $stidata = $interfaces[$stiname] #set $stidata = $interfaces[$stiname]
#if $stidata["interface_type"].lower() in ("slave"," bond_slave","bridge_slave") and $stidata["interface_master"].lower() == $tiname #if $stidata["interface_type"].lower() in ("bond_sla ve","bridge_slave") and $stidata["interface_master"].lower() == $tiname
#if $stidata["mac_address"] != '': #if $stidata["mac_address"] != '':
#set $mac = $stidata["mac_address"] #set $mac = $stidata["mac_address"]
# Found a slave for this interface: $tiname -> $stiname ($mac) # Found a slave for this interface: $tiname -> $stiname ($mac)
#break #break
#end if #end if
#end if #end if
#end for #end for
#end if #end if
#end for #end for
#end if #end if
skipping to change at line 123 skipping to change at line 132
#end if #end if
#if $len($name_servers) > 0 #if $len($name_servers) > 0
#set $netinfo = "%s --nameserver=%s" % ($netinfo, $name_serve rs[0]) #set $netinfo = "%s --nameserver=%s" % ($netinfo, $name_serve rs[0])
#end if #end if
#else if not $static #else if not $static
#set $netinfo = "--bootproto=dhcp" #set $netinfo = "--bootproto=dhcp"
#else #else
## Skip this interface, it's set as static, but without ## Skip this interface, it's set as static, but without
## networking info. ## networking info.
# Skipping (no configuration)... # Skipping (no configuration)...
# Ensure there is some pre_install_network_config file created
touch /tmp/pre_install_network_config
#continue #continue
#end if #end if
#if $hostname != "" #if $hostname != ""
#set $netinfo = "%s --hostname=%s" % ($netinfo, $hostname) #set $netinfo = "%s --hostname=%s" % ($netinfo, $hostname)
#end if #end if
# Configuring $iname ($mac) # Configuring $iname ($mac)
if mac_exists $mac if mac_exists $mac
then then
get_ifname $mac get_ifname $mac
echo "network --device=\$IFNAME $netinfo" >> /tmp/pre_install_network_config echo "network --device=\$IFNAME $netinfo" >> /tmp/pre_install_network_config
skipping to change at line 144 skipping to change at line 155
#if $routepattern.match($route) #if $routepattern.match($route)
#set $routebits = $route.split(":") #set $routebits = $route.split(":")
#set [$network, $router] = $route.split(":") #set [$network, $router] = $route.split(":")
ip route add $network via $router dev \$IFNAME ip route add $network via $router dev \$IFNAME
#else #else
# Warning: invalid route "$route" # Warning: invalid route "$route"
#end if #end if
#end for #end for
fi fi
#else #else
#if $iface_type.lower() in ("slave","bond_slave","bridge_slave","bon ded_bridge_slave") #if $iface_type.lower() in ("bond_slave","bridge_slave","bonded_brid ge_slave")
# Skipping (slave-interface) # Skipping (slave-interface)
#else #else
# Skipping (not a physical interface)... # Skipping (not a physical interface)...
#end if #end if
#end if #end if
#end for #end for
# End pre_install_network_config generated code # End pre_install_network_config generated code
#end if #end if
 End of changes. 8 change blocks. 
10 lines changed or deleted 20 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)