NSX|V Fail dist router set gw if edge not found

Sometimes during gateway-set the distributed router creation is not done yet,
and the edge-id is not found.
In this case we should make sure to produce an error before the 'super' method
adds the new GW to the DB.

Change-Id: I6faa824be3f70ed6f105e12b4fa2614e6f3e5c5f
This commit is contained in:
Adit Sarfaty 2017-04-30 08:49:53 +03:00
parent 630a78546d
commit 3223cc5943
1 changed files with 3 additions and 1 deletions

View File

@ -165,6 +165,9 @@ class RouterDistributedDriver(router_driver.RouterBaseDriver):
self.plugin._get_external_attachment_info(
context, router))
# verify the edge was deployed before calling super code.
tlr_edge_id = self._get_edge_id_or_raise(context, router_id)
super(nsx_v.NsxVPluginV2, self.plugin)._update_router_gw_info(
context, router_id, info, router=router)
@ -175,7 +178,6 @@ class RouterDistributedDriver(router_driver.RouterBaseDriver):
context, router))
plr_id = self.edge_manager.get_plr_by_tlr_id(context, router_id)
tlr_edge_id = self._get_edge_id(context, router_id)
if not new_ext_net_id:
if plr_id:
# delete all plr relative conf