Merge "NSX-V: fix exception for distributed router"

This commit is contained in:
Zuul 2018-06-14 08:38:54 +00:00 committed by Gerrit Code Review
commit ed4d20b20b

View File

@ -21,6 +21,7 @@ from neutron.db import l3_db
from neutron_lib import constants from neutron_lib import constants
from neutron_lib.db import api as db_api from neutron_lib.db import api as db_api
from neutron_lib import exceptions as n_exc 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.common import locking
from vmware_nsx.db import nsxv_db from vmware_nsx.db import nsxv_db
@ -236,7 +237,7 @@ class RouterDistributedDriver(router_driver.RouterBaseDriver):
raise n_exc.InvalidInput(error_message=err_msg) raise n_exc.InvalidInput(error_message=err_msg)
else: else:
# attach to multiple routers # 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 # Validate that the subnet is not a v6 one
subnet = self.plugin.get_subnet(context.elevated(), subnet_id) subnet = self.plugin.get_subnet(context.elevated(), subnet_id)
if (subnet.get('ip_version') == 6 or if (subnet.get('ip_version') == 6 or