Skip to content

Commit 9d20b4a

Browse files
Merge pull request #1233 from zhaoqin-github/router-exc
[OPENSTACK-2985] Fix RouterInterfaceDuplicateForSubnet exception
2 parents 35d3fe3 + 05793d7 commit 9d20b4a

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

f5lbaasdriver/v2/bigip/plugin_rpc.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -921,6 +921,19 @@ def attach_subnet_to_router(self, context, router_id=None, subnet_id=None):
921921
subnet_id)
922922
else:
923923
raise
924+
except Exception as ex:
925+
# SDN vendor might have their own router exception type. We
926+
# do not have exception definition, so that have to check
927+
# the error message.
928+
ignore_msg = "already has a port on subnet"
929+
if hasattr(ex, "message") and ignore_msg in ex.message:
930+
LOG.debug("Router is already attached to subnet %s",
931+
subnet_id)
932+
elif hasattr(ex, "msg") and ignore_msg in ex.msg:
933+
LOG.debug("Router is already attached to subnet %s",
934+
subnet_id)
935+
else:
936+
raise
924937

925938
@log_helpers.log_method_call
926939
def detach_subnet_from_router(self, context, router_id=None,

0 commit comments

Comments
 (0)