NSX|V: LOG.exception only when there is an exception

Change-Id: Ic2e926f622288f5ae1c213142f0191a419ea427d
This commit is contained in:
Gary Kotton 2017-06-13 02:43:50 -07:00 committed by garyk
parent a82b4c5944
commit 7832618c43
1 changed files with 3 additions and 3 deletions

View File

@ -219,10 +219,10 @@ def allocate_edge_vnic(session, edge_id, network_id):
binding['network_id'] = network_id
session.add(binding)
return binding
msg = (_("Failed to allocate one available vnic on edge_id: "
msg = (_("Edge VNIC: Failed to allocate one available vnic on edge_id: "
":%(edge_id)s to network_id: %(network_id)s") %
{'edge_id': edge_id, 'network_id': network_id})
LOG.exception(msg)
LOG.error(msg)
raise nsx_exc.NsxPluginException(err_msg=msg)
@ -255,7 +255,7 @@ def allocate_edge_vnic_with_tunnel_index(session, edge_id, network_id,
msg = (_("Failed to allocate one available vnic on edge_id: "
":%(edge_id)s to network_id: %(network_id)s") %
{'edge_id': edge_id, 'network_id': network_id})
LOG.exception(msg)
LOG.error(msg)
raise nsx_exc.NsxPluginException(err_msg=msg)
binding['network_id'] = network_id
session.add(binding)