NSX|V raise error on mdproxy init
When failing to create internal network or subnet, the mdproxy handler should raise an error, or else it will fail when returning None. Change-Id: I09e7eb13d9c76f9f3faa6a7ef50d6d8432225bd2
This commit is contained in:
parent
ff0fc94abe
commit
f08cd2e31c
@ -165,7 +165,6 @@ class NsxVMetadataProxyHandler(object):
|
|||||||
return int_net['network_id']
|
return int_net['network_id']
|
||||||
|
|
||||||
def _get_internal_network_and_subnet(self, context):
|
def _get_internal_network_and_subnet(self, context):
|
||||||
|
|
||||||
# Try to find internal net, internal subnet. If not found, create new
|
# Try to find internal net, internal subnet. If not found, create new
|
||||||
internal_net = self._get_internal_net_by_az(context)
|
internal_net = self._get_internal_net_by_az(context)
|
||||||
internal_subnet = None
|
internal_subnet = None
|
||||||
@ -194,9 +193,10 @@ class NsxVMetadataProxyHandler(object):
|
|||||||
self.nsxv_plugin.delete_network(context,
|
self.nsxv_plugin.delete_network(context,
|
||||||
internal_net)
|
internal_net)
|
||||||
|
|
||||||
LOG.exception("Exception %s while creating internal "
|
error = (_("Exception %s while creating internal "
|
||||||
"network for metadata service", e)
|
"network for metadata service") % e)
|
||||||
return
|
LOG.exception(error)
|
||||||
|
raise nsxv_exc.NsxPluginException(err_msg=error)
|
||||||
|
|
||||||
# Update the new network_id in DB
|
# Update the new network_id in DB
|
||||||
nsxv_db.create_nsxv_internal_network(
|
nsxv_db.create_nsxv_internal_network(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user