summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-06-15 21:31:30 +0000
committerGerrit Code Review <review@openstack.org>2017-06-15 21:31:30 +0000
commitfa0976346167b4be6059741c9fedd1cf6a5160c3 (patch)
tree1d66f34edea4cbe21e0f01de0e805315e077c4f0
parent41fcc4fb5e8efc18e50ec77b26edd164cd007253 (diff)
parentb5b68b3752c0bc1d58d35eddd9bf3dae95550261 (diff)
Merge "Retry ebtables lock acquisition failures" into stable/newton
-rw-r--r--neutron/plugins/ml2/drivers/linuxbridge/agent/arp_protect.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/neutron/plugins/ml2/drivers/linuxbridge/agent/arp_protect.py b/neutron/plugins/ml2/drivers/linuxbridge/agent/arp_protect.py
index ec05b12..16219ed 100644
--- a/neutron/plugins/ml2/drivers/linuxbridge/agent/arp_protect.py
+++ b/neutron/plugins/ml2/drivers/linuxbridge/agent/arp_protect.py
@@ -16,9 +16,11 @@
16import netaddr 16import netaddr
17from oslo_concurrency import lockutils 17from oslo_concurrency import lockutils
18from oslo_log import log as logging 18from oslo_log import log as logging
19import retrying
19 20
20from neutron._i18n import _LI 21from neutron._i18n import _LI
21from neutron.agent.linux import ip_lib 22from neutron.agent.linux import ip_lib
23from neutron.agent.linux import utils as linux_utils
22from neutron.common import utils 24from neutron.common import utils
23 25
24LOG = logging.getLogger(__name__) 26LOG = logging.getLogger(__name__)
@@ -189,6 +191,17 @@ def _delete_mac_spoofing_protection(vifs, current_rules):
189NAMESPACE = None 191NAMESPACE = None
190 192
191 193
194def _retry_on_returncode_255(e):
195 if isinstance(e, linux_utils.ProcessExecutionError):
196 return e.returncode == 255
197 return False
198
199
200@retrying.retry(
201 stop_max_attempt_number=10,
202 wait_exponential_multiplier=0.01,
203 retry_on_exception=_retry_on_returncode_255
204)
192def ebtables(comm): 205def ebtables(comm):
193 execute = ip_lib.IPWrapper(NAMESPACE).netns.execute 206 execute = ip_lib.IPWrapper(NAMESPACE).netns.execute
194 return execute(['ebtables', '--concurrent'] + comm, run_as_root=True) 207 return execute(['ebtables', '--concurrent'] + comm, run_as_root=True)