Skip to content

Commit

Permalink
Added network read inside try & except block
Browse files Browse the repository at this point in the history
Change-Id: I3d26e4031d12c4447280855d725a1516f6a32e8d
Closes-Bug: 1684322
  • Loading branch information
sahilsabharwal committed Apr 28, 2017
1 parent 2ed24ec commit 08eb410
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/config/vnc_openstack/vnc_openstack/neutron_plugin_db.py
Expand Up @@ -3577,7 +3577,11 @@ def _port_create_instance_ip(self, net_obj, port_obj, port_q, ip_family="v4"):
@wait_for_api_server_connection
def port_create(self, context, port_q):
net_id = port_q['network_id']
net_obj = self._network_read(net_id)
try:
net_obj = self._network_read(net_id)
except NoIdError:
self._raise_contrail_exception('NetworkNotFound',
net_id=net_id)
tenant_id = self._get_tenant_id_for_create(context, port_q);
proj_id = str(uuid.UUID(tenant_id))

Expand Down

0 comments on commit 08eb410

Please sign in to comment.