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 <mkelnermishal@vmware.com>
This commit is contained in:
Michal Kelner Mishali 2018-06-07 12:26:01 +03:00
parent 4b4fd78454
commit 7a402d2bdc
1 changed files with 2 additions and 1 deletions

View File

@ -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