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
(cherry picked from commit 61b0d665e6
)
This commit is contained in:
parent
ebf14d2f54
commit
adff3c49df
|
@ -1366,20 +1366,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:
|
||||
|
|
Loading…
Reference in New Issue