From 8dd65f08d5adefaf7c15d1fc089fa07a7008af1e Mon Sep 17 00:00:00 2001 From: vishala Date: Tue, 18 Oct 2016 23:36:40 -0700 Subject: [PATCH] Raising proper error in case of router-interface addition Currently when user tries to add a logical switch to 2nd router a proper error message is not generated. This patch takes care of it. Change-Id: If81aea2c11235df71498ea2d68e03c7c7176445e --- vmware_nsx/plugins/nsx_v3/plugin.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/vmware_nsx/plugins/nsx_v3/plugin.py b/vmware_nsx/plugins/nsx_v3/plugin.py index 945fc46235..d20202cf57 100644 --- a/vmware_nsx/plugins/nsx_v3/plugin.py +++ b/vmware_nsx/plugins/nsx_v3/plugin.py @@ -2584,14 +2584,13 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin, "to router %(router_id)s") % { 'net_id': net_id, 'router_id': router_ids[0]} + LOG.error(err_msg) if router_id in router_ids: - LOG.error(err_msg) # attach to the same router again raise n_exc.InvalidInput(error_message=err_msg) else: - LOG.error(err_msg) # attach to multiple routers - raise n_exc.Conflict(error_message=err_msg) + raise l3.RouterInterfaceAttachmentConflict(reason=err_msg) def _add_router_interface_wrapper(self, context, router_id, interface_info):