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.
elif interface['method'] == "dhcp":
inter['BOOTPROTO'] = "dhcp"
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"
if not interface['is_primary']:
inter['DHCLIENTARGS'] = "-R subnet-mask"