NSX|V: Fix error message for add router interface
Change-Id: Id7db7e6d6d5ace173d7ebd06000c9692217e0d8c
This commit is contained in:
parent
3aaad8b752
commit
dc6b287a9a
|
@ -4103,18 +4103,22 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin,
|
||||||
return router_driver.add_router_interface(
|
return router_driver.add_router_interface(
|
||||||
context, router_id, interface_info)
|
context, router_id, interface_info)
|
||||||
except vsh_exc.VcnsApiException as e:
|
except vsh_exc.VcnsApiException as e:
|
||||||
|
json_response = jsonutils.loads(e.response)
|
||||||
|
details = json_response.get('details')
|
||||||
|
msg = details or e.response
|
||||||
LOG.error("Failed to add interface_info %(info)s on "
|
LOG.error("Failed to add interface_info %(info)s on "
|
||||||
"router %(router_id)s: %(e)s",
|
"router %(router_id)s: %(e)s",
|
||||||
{'info': str(interface_info),
|
{'info': str(interface_info),
|
||||||
'router_id': router_id,
|
'router_id': router_id,
|
||||||
'e': e.message})
|
'e': msg})
|
||||||
try:
|
try:
|
||||||
router_driver.remove_router_interface(
|
router_driver.remove_router_interface(
|
||||||
context, router_id, interface_info)
|
context, router_id, interface_info)
|
||||||
except Exception:
|
except Exception:
|
||||||
# Rollback may fail if creation failed too early
|
# Rollback may fail if creation failed too early
|
||||||
pass
|
pass
|
||||||
raise nsx_exc.NsxPluginException(err_msg=e.message)
|
# Log the original error
|
||||||
|
raise nsx_exc.NsxPluginException(err_msg=msg)
|
||||||
|
|
||||||
def remove_router_interface(self, context, router_id, interface_info):
|
def remove_router_interface(self, context, router_id, interface_info):
|
||||||
# Get the router interface port id
|
# Get the router interface port id
|
||||||
|
|
Loading…
Reference in New Issue