Merge "Not set fip to ERROR if it exists on device" into stable/rocky

This commit is contained in:
Zuul 2019-04-10 19:54:38 +00:00 committed by Gerrit Code Review
commit 2f4286890a
2 changed files with 5 additions and 3 deletions

View File

@ -325,10 +325,11 @@ class DvrEdgeRouter(dvr_local_router.DvrLocalRouter):
return
interface_name = self.get_snat_external_device_interface_name(
self.get_ex_gw_port())
device = ip_lib.IPDevice(
interface_name, namespace=self.snat_namespace.name)
try:
device.addr.add(fip_cidr)
ip_lib.add_ip_address(fip_cidr, interface_name,
namespace=self.snat_namespace.name)
except ip_lib.IpAddressAlreadyExists:
pass
except RuntimeError:
LOG.warning("Unable to configure IP address for centralized "
"floating IP: %s", fip['id'])

View File

@ -978,6 +978,7 @@ def get_device_mtu(device_name, namespace=None):
NetworkNamespaceNotFound = privileged.NetworkNamespaceNotFound
NetworkInterfaceNotFound = privileged.NetworkInterfaceNotFound
IpAddressAlreadyExists = privileged.IpAddressAlreadyExists
def add_ip_address(cidr, device, namespace=None, scope='global',