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.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/os_net_config/impl_ifcfg.py b/os_net_config/impl_ifcfg.py
index 78433d8..47f32a6 100644
--- a/os_net_config/impl_ifcfg.py
+++ b/os_net_config/impl_ifcfg.py
@@ -51,6 +51,7 @@ class IfcfgNetConfig(os_net_config.NetConfig):
self.route_data = {}
self.bridge_data = {}
self.member_names = {}
+ self.renamed_interfaces = {}
logger.info('Ifcfg net config provider created.')
def child_members(self, name):
@@ -172,6 +173,11 @@ class IfcfgNetConfig(os_net_config.NetConfig):
if interface.routes:
self._add_routes(interface.name, interface.routes)
+ if interface.renamed:
+ logger.info("Interface %s being renamed to %s"
+ % (interface.hwname, interface.name))
+ self.renamed_interfaces[interface.hwname] = interface.name
+
def add_vlan(self, vlan):
"""Add a Vlan object to the net config object.
@@ -275,6 +281,9 @@ class IfcfgNetConfig(os_net_config.NetConfig):
for bridge in restart_bridges:
self.ifdown(bridge, iftype='bridge')
+ for oldname, newname in self.renamed_interfaces.iteritems():
+ self.ifrename(oldname, newname)
+
for location, data in update_files.iteritems():
self.write_config(location, data)