From 61b0d665e6b9a0ff35ce06e2bcc315a54e4efbdb Mon Sep 17 00:00:00 2001 From: Dan Sneddon Date: Fri, 30 Nov 2018 13:14:59 -0800 Subject: [PATCH] Fix incorrect application of 'ip' commands for bridges The code that applies iproute2 commands to bridges that are modified specifies "interface" rather than "bridge", so it does not function correctly. This patch fixes the typos so that bridges will have updates applied through iproute2 if a restart is not required. Change-Id: I53df2f3506cca2b69e4f1f59471c7b90dc8fdfb7 Closes-bug: 1806128 --- os_net_config/impl_ifcfg.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/os_net_config/impl_ifcfg.py b/os_net_config/impl_ifcfg.py index bf3c16ae..625ebb9f 100644 --- a/os_net_config/impl_ifcfg.py +++ b/os_net_config/impl_ifcfg.py @@ -1355,20 +1355,20 @@ class IfcfgNetConfig(os_net_config.NetConfig): for bridge in apply_bridges: logger.debug('Running ip commands on bridge: %s' % - interface[0]) - commands = self.iproute2_apply_commands(interface[0], - interface[1], - interface[2]) + bridge[0]) + commands = self.iproute2_apply_commands(bridge[0], + bridge[1], + bridge[2]) for command in commands: try: args = command.split() self.execute('Running ip %s' % command, ipcmd, *args) except Exception as e: logger.warning("Error in 'ip %s', restarting %s:\n%s" % - (command, interface[0], str(e))) - restart_bridges.append(interface[0]) + (command, bridge[0], str(e))) + restart_bridges.append(bridge[0]) restart_interfaces.extend( - self.child_members(interface[0])) + self.child_members(bridge[0])) break for interface in apply_routes: