- inter = {}
- inter['ONBOOT']='yes'
- inter['USERCTL']='no'
- if network['mac']:
- inter['HWADDR'] = network['mac']
- if network['is_primary']:
- inter['PRIMARY']='yes'
-
- if network['method'] == "static":
- inter['BOOTPROTO'] = "static"
- inter['IPADDR'] = network['ip']
- inter['NETMASK'] = network['netmask']
- if network['is_primary']:
- gateway = network['gateway']
- if network['dns1']:
- inter['DNS1'] = network['dns1']
- if network['dns2']:
- inter['DNS2'] = network['dns2']
-
- elif network['method'] == "dhcp":
- inter['BOOTPROTO'] = "dhcp"
- inter['PERSISTENT_DHCLIENT'] = "yes"
- if network['hostname']:
- inter['DHCP_HOSTNAME'] = network['hostname']
+ details = {}
+ details['ONBOOT']='yes'
+ details['USERCTL']='no'
+ if interface['mac']:
+ details['HWADDR'] = interface['mac']
+ if interface['is_primary']:
+ details['PRIMARY']='yes'
+
+ if interface['method'] == "static":
+ details['BOOTPROTO'] = "static"
+ details['IPADDR'] = interface['ip']
+ details['NETMASK'] = interface['netmask']
+ if interface['is_primary']:
+ gateway = interface['gateway']
+ if interface['dns1']:
+ details['DNS1'] = interface['dns1']
+ if interface['dns2']:
+ details['DNS2'] = interface['dns2']
+
+ elif interface['method'] == "dhcp":
+ details['BOOTPROTO'] = "dhcp"
+ details['PERSISTENT_DHCLIENT'] = "yes"
+ if interface['hostname']:
+ details['DHCP_HOSTNAME'] = interface['hostname']