NSX|V: check edge ID before locking edge

Random failues in unit tests may cause execptions

Change-Id: I99b52abe70fd4f1d43a8ab81f39c754304714d6e
This commit is contained in:
Gary Kotton 2017-03-29 23:08:26 +03:00
parent 350cb07e10
commit 24827f3621

View File

@ -437,6 +437,11 @@ class NsxVMetadataProxyHandler(object):
rtr_id = rtr['id']
edge_id = self._get_edge_id_by_rtr_id(context, rtr_id)
if not edge_id:
LOG.error('No edge create for router - %s', rtr_id)
if rtr_id:
self.nsxv_plugin.delete_router(context, rtr_id)
return
self.nsxv_plugin.nsx_v.update_interface(
rtr['id'],