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
(cherry picked from commit 3223cc5943)
This commit is contained in:
Adit Sarfaty 2017-04-30 08:49:53 +03:00 committed by Gary Kotton
parent eb0e0eb846
commit b937406369
1 changed files with 3 additions and 0 deletions

View File

@ -163,6 +163,9 @@ class RouterDistributedDriver(router_driver.RouterBaseDriver):
self.plugin._get_external_attachment_info(
context, router))
# verify the edge was deployed before calling super code.
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)