From 7a402d2bdcef7a79ae229b3f49ad048b86bb1b41 Mon Sep 17 00:00:00 2001 From: Michal Kelner Mishali Date: Thu, 7 Jun 2018 12:26:01 +0300 Subject: [PATCH] NSX-V: fix exception for distributed router When trying to add interface to another distributed router, a proper message should notify the user that this is incorrect and not supported. Change-Id: If9230c821665813939e676fbaafe296d42cac498 Signed-off-by: Michal Kelner Mishali --- vmware_nsx/plugins/nsx_v/drivers/distributed_router_driver.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vmware_nsx/plugins/nsx_v/drivers/distributed_router_driver.py b/vmware_nsx/plugins/nsx_v/drivers/distributed_router_driver.py index 6a92ac921b..58cf00cec9 100644 --- a/vmware_nsx/plugins/nsx_v/drivers/distributed_router_driver.py +++ b/vmware_nsx/plugins/nsx_v/drivers/distributed_router_driver.py @@ -21,6 +21,7 @@ from neutron.db import l3_db from neutron_lib import constants from neutron_lib.db import api as db_api from neutron_lib import exceptions as n_exc +from neutron_lib.exceptions import l3 as l3_exc from vmware_nsx.common import locking from vmware_nsx.db import nsxv_db @@ -236,7 +237,7 @@ class RouterDistributedDriver(router_driver.RouterBaseDriver): raise n_exc.InvalidInput(error_message=err_msg) else: # attach to multiple routers - raise n_exc.Conflict(error_message=err_msg) + raise l3_exc.RouterInterfaceAttachmentConflict(reason=err_msg) # Validate that the subnet is not a v6 one subnet = self.plugin.get_subnet(context.elevated(), subnet_id) if (subnet.get('ip_version') == 6 or