Daniel rightly pointed out that my change to use
authorMarc Fiuczynski <mef@cs.princeton.edu>
Wed, 5 Nov 2008 13:59:35 +0000 (13:59 +0000)
committerMarc Fiuczynski <mef@cs.princeton.edu>
Wed, 5 Nov 2008 13:59:35 +0000 (13:59 +0000)
interface.get('hostname',hostname) instead of an if/then/else on
interface['hostname'] was not semantically equivalent.  Reverted to
the original code for this case.

source/steps/WriteNetworkConfig.py

index 46ce122..02d93ba 100644 (file)
@@ -175,7 +175,10 @@ def Run( vars, log ):
 
             elif interface['method'] == "dhcp":
                 inter['BOOTPROTO'] = "dhcp"
-                inter['DHCP_HOSTNAME'] = interface.get('hostname',hostname)
+                if interface['hostname']:
+                    inter['DHCP_HOSTNAME'] = interface['hostname']
+                else:
+                    inter['DHCP_HOSTNAME'] = hostname 
                 if not interface['is_primary']:
                     inter['DHCLIENTARGS'] = "-R subnet-mask"