SKIP_HARDWARE_REQUIREMENT_CHECK Whether or not we should skip hardware
requirement checks
NODE_SESSION The session value returned from BootGetNodeDetails
+ NODE_NETWORKS The networks associated with this node
Return 1 if able to contact PLC and get node info.
Raise a BootManagerException if anything fails.
if not got_primary:
raise BootManagerException, "Node did not have a primary network."
+
+ vars['NODE_NETWORKS']= node_networks
log.write( "Primary network as returned from PLC: %s\n" % str(network) )
(always starts with TEMP_PATH)
NETWORK_SETTINGS A dictionary of the values from the network
configuration file
+ NODE_NETWORKS All the network associated with this node
Sets the following variables:
None
"""
network_file.write( "GATEWAY=%s\n" % gateway )
network_file.close()
network_file= None
+
+ interface = 1
+ for network in vars['NODE_NETWORKS']:
+ if network['is_primary'] == 1:
+ continue
+ if method == "static" or method == "dhcp":
+ f = file("%s/etc/sysconfig/network-scripts/ifcfg-eth%d" %
+ (SYSIMG_PATH, interface), "w")
+ f.write("DEVICE=eth%d\n" % interface)
+ f.write("HWADDR=%s\n" % mac)
+ f.write("ONBOOT=yes\n")
+ f.write("USERCTL=no\n")
+ if method == "static":
+ f.write("BOOTPROTO=static\n")
+ f.write("IPADDR=%s\n" % network['ip'])
+ f.write("NETMASK=%s\n" % network['netmask'])
+ elif method == "dhcp":
+ f.write("BOOTPROTO=dhcp\n")
+ if network['hostname']:
+ f.write("DHCP_HOSTNAME=%s\n" % network['hostname'])
+ else:
+ f.write("DHCP_HOSTNAME=%s\n" % hostname)
+ f.write("DHCLIENTARGS='-R subnet-mask'\n")
+ f.close()
+