From 3d6c45c571503122741233a27a9e43c2fb56ecac Mon Sep 17 00:00:00 2001 From: Steven Hardy Date: Thu, 22 Jan 2015 12:41:02 +0000 Subject: Refactor ifup/ifdown into base-class Refactor some common code so the base-class handles the ifup/down Change-Id: Id1fee1d2d5c9315717611b7bf18f058c49fe3622 --- os_net_config/impl_eni.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 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 880c4e4..5f46f33 100644 --- a/os_net_config/impl_eni.py +++ b/os_net_config/impl_eni.py @@ -211,24 +211,18 @@ class ENINetConfig(os_net_config.NetConfig): if (utils.diff(_network_config_path(), new_config)): for interface in self.interfaces.keys(): - msg = 'running ifdown on interface: %s' % interface - self.execute(msg, '/sbin/ifdown', interface, - check_exit_code=False) + self.ifdown(interface) for bridge in self.bridges.keys(): - msg = 'running ifdown on bridge: %s' % bridge - self.execute(msg, '/sbin/ifdown', bridge, - check_exit_code=False) + self.ifdown(bridge, iftype='bridge') self.write_config(_network_config_path(), new_config) for bridge in self.bridges.keys(): - msg = 'running ifup on bridge: %s' % bridge - self.execute(msg, '/sbin/ifup', bridge) + self.ifup(bridge, iftype='bridge') for interface in self.interfaces.keys(): - msg = 'running ifup on interface: %s' % interface - self.execute(msg, '/sbin/ifup', interface) + self.ifup(interface) else: logger.info('No interface changes are required.') -- cgit 1.2.3-korg