aboutsummaryrefslogtreecommitdiffstats
path: root/os_net_config/impl_ifcfg.py
diff options
context:
space:
mode:
Diffstat (limited to 'os_net_config/impl_ifcfg.py')
-rw-r--r--os_net_config/impl_ifcfg.py38
1 files changed, 22 insertions, 16 deletions
diff --git a/os_net_config/impl_ifcfg.py b/os_net_config/impl_ifcfg.py
index 41d5f8c..6d3c681 100644
--- a/os_net_config/impl_ifcfg.py
+++ b/os_net_config/impl_ifcfg.py
@@ -131,7 +131,10 @@ class IfcfgNetConfig(os_net_config.NetConfig):
data = "# This file is autogenerated by os-net-config\n"
data += "DEVICE=%s\n" % base_opt.name
data += "ONBOOT=yes\n"
- data += "HOTPLUG=no\n"
+ if isinstance(base_opt, objects.Interface) and base_opt.hotplug:
+ data += "HOTPLUG=yes\n"
+ else:
+ data += "HOTPLUG=no\n"
data += "NM_CONTROLLED=no\n"
if not base_opt.dns_servers and not base_opt.use_dhcp:
data += "PEERDNS=no\n"
@@ -283,15 +286,18 @@ class IfcfgNetConfig(os_net_config.NetConfig):
data += "OVS_BRIDGE=%s\n" % base_opt.bridge_name
elif isinstance(base_opt, objects.OvsDpdkBond):
ovs_extra.extend(base_opt.ovs_extra)
- if base_opt.primary_interface_name:
- primary_name = base_opt.primary_interface_name
- self.bond_primary_ifaces[base_opt.name] = primary_name
+ # Referring to bug:1643026, the below commenting of the interfaces,
+ # is to workaround the error, but is not the long term solution.
+ # The long term solution is to run DPDK options before
+ # os-net-config, which is being tracked at BUG:1654975
+ # if base_opt.primary_interface_name:
+ # primary_name = base_opt.primary_interface_name
+ # self.bond_primary_ifaces[base_opt.name] = primary_name
data += "DEVICETYPE=ovs\n"
data += "TYPE=OVSDPDKBond\n"
data += "OVS_BRIDGE=%s\n" % base_opt.bridge_name
if base_opt.members:
members = [member.name for member in base_opt.members]
- self.member_names[base_opt.name] = members
data += ("BOND_IFACES=\"%s\"\n" % " ".join(members))
if base_opt.ovs_options:
data += "OVS_OPTIONS=\"%s\"\n" % base_opt.ovs_options
@@ -678,7 +684,7 @@ class IfcfgNetConfig(os_net_config.NetConfig):
nfvswitch_internal_ifaces = [] # nfvswitch internal/management ports
stop_dhclient_interfaces = []
- for interface_name, iface_data in self.interface_data.iteritems():
+ for interface_name, iface_data in self.interface_data.items():
route_data = self.route_data.get(interface_name, '')
route6_data = self.route6_data.get(interface_name, '')
interface_path = self.root_dir + ifcfg_config_path(interface_name)
@@ -706,7 +712,7 @@ class IfcfgNetConfig(os_net_config.NetConfig):
logger.info('No changes required for interface: %s' %
interface_name)
- for interface_name, iface_data in self.ivsinterface_data.iteritems():
+ for interface_name, iface_data in self.ivsinterface_data.items():
route_data = self.route_data.get(interface_name, '')
route6_data = self.route6_data.get(interface_name, '')
interface_path = self.root_dir + ifcfg_config_path(interface_name)
@@ -727,7 +733,7 @@ class IfcfgNetConfig(os_net_config.NetConfig):
logger.info('No changes required for ivs interface: %s' %
interface_name)
- for iface_name, iface_data in self.nfvswitch_intiface_data.iteritems():
+ for iface_name, iface_data in self.nfvswitch_intiface_data.items():
route_data = self.route_data.get(iface_name, '')
route6_data = self.route6_data.get(iface_name, '')
iface_path = self.root_dir + ifcfg_config_path(iface_name)
@@ -748,7 +754,7 @@ class IfcfgNetConfig(os_net_config.NetConfig):
logger.info('No changes required for nfvswitch interface: %s' %
iface_name)
- for vlan_name, vlan_data in self.vlan_data.iteritems():
+ for vlan_name, vlan_data in self.vlan_data.items():
route_data = self.route_data.get(vlan_name, '')
route6_data = self.route6_data.get(vlan_name, '')
vlan_path = self.root_dir + ifcfg_config_path(vlan_name)
@@ -768,7 +774,7 @@ class IfcfgNetConfig(os_net_config.NetConfig):
logger.info('No changes required for vlan interface: %s' %
vlan_name)
- for bridge_name, bridge_data in self.bridge_data.iteritems():
+ for bridge_name, bridge_data in self.bridge_data.items():
route_data = self.route_data.get(bridge_name, '')
route6_data = self.route6_data.get(bridge_name, '')
bridge_path = self.root_dir + bridge_config_path(bridge_name)
@@ -792,7 +798,7 @@ class IfcfgNetConfig(os_net_config.NetConfig):
else:
logger.info('No changes required for bridge: %s' % bridge_name)
- for bridge_name, bridge_data in self.linuxbridge_data.iteritems():
+ for bridge_name, bridge_data in self.linuxbridge_data.items():
route_data = self.route_data.get(bridge_name, '')
route6_data = self.route6_data.get(bridge_name, '')
bridge_path = self.root_dir + bridge_config_path(bridge_name)
@@ -812,7 +818,7 @@ class IfcfgNetConfig(os_net_config.NetConfig):
else:
logger.info('No changes required for bridge: %s' % bridge_name)
- for team_name, team_data in self.linuxteam_data.iteritems():
+ for team_name, team_data in self.linuxteam_data.items():
route_data = self.route_data.get(team_name, '')
route6_data = self.route6_data.get(team_name, '')
team_path = self.root_dir + bridge_config_path(team_name)
@@ -833,7 +839,7 @@ class IfcfgNetConfig(os_net_config.NetConfig):
logger.info('No changes required for linux team: %s' %
team_name)
- for bond_name, bond_data in self.linuxbond_data.iteritems():
+ for bond_name, bond_data in self.linuxbond_data.items():
route_data = self.route_data.get(bond_name, '')
route6_data = self.route6_data.get(bond_name, '')
bond_path = self.root_dir + bridge_config_path(bond_name)
@@ -855,7 +861,7 @@ class IfcfgNetConfig(os_net_config.NetConfig):
bond_name)
# Infiniband interfaces are handled similarly to Ethernet interfaces
- for interface_name, iface_data in self.ib_interface_data.iteritems():
+ for interface_name, iface_data in self.ib_interface_data.items():
route_data = self.route_data.get(interface_name, '')
route6_data = self.route6_data.get(interface_name, '')
interface_path = self.root_dir + ifcfg_config_path(interface_name)
@@ -906,10 +912,10 @@ class IfcfgNetConfig(os_net_config.NetConfig):
for bridge in restart_bridges:
self.ifdown(bridge, iftype='bridge')
- for oldname, newname in self.renamed_interfaces.iteritems():
+ for oldname, newname in self.renamed_interfaces.items():
self.ifrename(oldname, newname)
- for location, data in update_files.iteritems():
+ for location, data in update_files.items():
self.write_config(location, data)
if ivs_uplinks or ivs_interfaces: