Skip to content

Commit ddd01ee

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Retry set|get_link_attribute(s) if the interface is not present" into stable/zed
2 parents aedb872 + 32d7efb commit ddd01ee

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

neutron/privileged/agent/linux/ip_lib.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,10 @@ def set_link_flags(device, namespace, flags):
348348
_run_iproute_link("set", device, namespace, flags=new_flags)
349349

350350

351+
@tenacity.retry(
352+
retry=tenacity.retry_if_exception_type(NetworkInterfaceNotFound),
353+
wait=tenacity.wait_exponential(multiplier=0.02, max=1),
354+
stop=tenacity.stop_after_delay(3), reraise=True)
351355
@privileged.link_cmd.entrypoint
352356
def set_link_attribute(device, namespace, **attributes):
353357
_run_iproute_link("set", device, namespace, **attributes)
@@ -378,7 +382,8 @@ def set_link_bridge_master(device, bridge, namespace=None):
378382

379383
@tenacity.retry(
380384
retry=tenacity.retry_if_exception_type(
381-
netlink_exceptions.NetlinkDumpInterrupted),
385+
(netlink_exceptions.NetlinkDumpInterrupted,
386+
NetworkInterfaceNotFound)),
382387
wait=tenacity.wait_exponential(multiplier=0.02, max=1),
383388
stop=tenacity.stop_after_delay(8),
384389
reraise=True)

0 commit comments

Comments
 (0)