Add additional exception handling to ARP cleanup.

This was originally resolved in Mitaka via
http://git.openstack.org/cgit/openstack/astara-appliance/commit/?id=02383adf645c479aba2838602c90fd5135fd0417
Backporting this as it has the potential to break the router build+configure
process.

Closes bug #1582736
Change-Id: If2ddbf5f2080b29c876e7750ba3b81f15ab3cc08
This commit is contained in:
Ryan Petrello 2016-05-17 10:07:49 -04:00
parent 5668a25ff2
commit fcb3aa8c5b
2 changed files with 7 additions and 3 deletions

View File

@ -155,4 +155,8 @@ class ARPManager(base.Manager):
:type ip: str
:param ip: IP address to search for in the ARP table.
"""
self.sudo('-d', ip)
try:
self.sudo('-d', ip)
except:
# It's possible that these have already been cleaned up
pass

View File

@ -205,10 +205,10 @@ class IPManager(base.Manager):
add = functools.partial(_gen_cmd, 'add')
delete = functools.partial(_gen_cmd, 'del')
mutator = lambda a: (a.ip, a.prefixlen)
self._update_set(real_ifname, interface, old_interface,
'all_addresses', add, delete, mutator)
'all_addresses', add, delete,
lambda a: (a.ip, a.prefixlen))
def _update_set(self, real_ifname, interface, old_interface, attribute,
fmt_args_add, fmt_args_delete, mutator=lambda x: x):