patch from E Jaffe to fix eth0 config files with mac address (if specified)
authorAaron Klingaman <alk@cs.princeton.edu>
Tue, 20 Dec 2005 05:56:06 +0000 (05:56 +0000)
committerAaron Klingaman <alk@cs.princeton.edu>
Tue, 20 Dec 2005 05:56:06 +0000 (05:56 +0000)
source/steps/InstallWriteConfig.py

index 45c7156..b9fd28f 100644 (file)
@@ -359,6 +359,7 @@ def write_network_configuration( vars, log ):
         network= network_settings['network']
         netmask= network_settings['netmask']
         dns1= network_settings['dns1']
+        mac= network_settings['mac']
     except KeyError, e:
         raise BootManagerException, "Missing value %s in network settings." % str(e)
 
@@ -390,6 +391,8 @@ def write_network_configuration( vars, log ):
     else:
         eth0_file.write( "BOOTPROTO=dhcp\n" )
         eth0_file.write( "DHCP_HOSTNAME=%s\n" % hostname )
+    if mac != "":
+        eth0_file.write( "HWADDR=%s\n" % mac )
     eth0_file.write( "ONBOOT=yes\n" )
     eth0_file.write( "USERCTL=no\n" )
     eth0_file.close()