Retry ovs-appctl command
The ovs-appctl command may fail when setting an interface as a slave interface in a bond and the primary has not come up yet from a preceding ifup call. Retry the ovs-appctl and log an error if the command still fails. Change-Id: I3f04a5d6c3a6dc324a2978fdecd2a77df0bf1ba0 Closes-Bug: 1797955
This commit is contained in:
parent
acf646383b
commit
25c70ea076
@ -334,5 +334,19 @@ class NetConfig(object):
|
||||
'link', 'set', 'dev', newname, 'up')
|
||||
|
||||
def ovs_appctl(self, action, *parameters):
|
||||
"""Run 'ovs-appctl' with the specified action
|
||||
|
||||
Its possible the command may fail due to timing if, for example,
|
||||
the command affects an interface and it the prior ifup command
|
||||
has not completed. So retry the command and if a failures still
|
||||
occurs save the error for later handling.
|
||||
|
||||
:param action: The ovs-appctl action.
|
||||
:param parameters: Parameters to pass to ovs-appctl.
|
||||
"""
|
||||
msg = 'Running ovs-appctl %s %s' % (action, parameters)
|
||||
self.execute(msg, '/bin/ovs-appctl', action, *parameters)
|
||||
try:
|
||||
self.execute(msg, '/bin/ovs-appctl', action, *parameters,
|
||||
delay_on_retry=True, attempts=5)
|
||||
except processutils.ProcessExecutionError as e:
|
||||
self.errors.append(e)
|
||||
|
@ -0,0 +1,6 @@
|
||||
---
|
||||
fixes:
|
||||
- The ovs-appctl command may fail, particularly when setting an
|
||||
interface as a slave in a bond if the primary interface is not
|
||||
yet up. Retry the ovs-appctl command and log a failure if the
|
||||
command still fails.
|
Loading…
Reference in New Issue
Block a user