From b3318a4c54e685733bff9e5a09c00a6cce50241d Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Thu, 3 Jul 2014 14:12:01 -0400 Subject: ENI: bring up bridges first on Debian We should bring up the interfaces on boot in the same order with which we bring them up in this tool. --- os_net_config/impl_eni.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'os_net_config/impl_eni.py') diff --git a/os_net_config/impl_eni.py b/os_net_config/impl_eni.py index f676a7e..b600fd9 100644 --- a/os_net_config/impl_eni.py +++ b/os_net_config/impl_eni.py @@ -149,15 +149,19 @@ class ENINetConfig(os_net_config.NetConfig): def apply(self): new_config = "" - for interface_name, iface_data in self.interfaces.iteritems(): - route_data = self.routes.get(interface_name) - iface_data += (route_data or '') - new_config += iface_data + # write out bridges first. This ensures that an ifup -a + # on reboot brings them up first for bridge_name, bridge_data in self.bridges.iteritems(): route_data = self.routes.get(bridge_name) bridge_data += (route_data or '') new_config += bridge_data + + for interface_name, iface_data in self.interfaces.iteritems(): + route_data = self.routes.get(interface_name) + iface_data += (route_data or '') + new_config += iface_data + if (utils.diff(_network_config_path(), new_config)): for interface in self.interfaces.keys(): processutils.execute('/sbin/ifdown', interface, -- cgit 1.2.3-korg