From cc0609b5b401e307e27d864663c9c09d999f80f2 Mon Sep 17 00:00:00 2001 From: Gary Kotton Date: Thu, 30 Jun 2016 01:48:35 -0700 Subject: [PATCH] NSX|V: don't log eception when edge is not active There is no need to log the exception trace when an edge is down or in error state. A log error is sufficient. Change-Id: Icf06db06f3f3e02f01917d543d269b3b4c317aa9 --- vmware_nsx/plugins/nsx_v/vshield/edge_appliance_driver.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vmware_nsx/plugins/nsx_v/vshield/edge_appliance_driver.py b/vmware_nsx/plugins/nsx_v/vshield/edge_appliance_driver.py index 75bcd5df49..c60f98148c 100644 --- a/vmware_nsx/plugins/nsx_v/vshield/edge_appliance_driver.py +++ b/vmware_nsx/plugins/nsx_v/vshield/edge_appliance_driver.py @@ -223,8 +223,9 @@ class EdgeApplianceDriver(object): status_level = self._edge_status_to_level( response['edgeStatus']) except exceptions.VcnsApiException as e: - LOG.exception(_LE("VCNS: Failed to get edge status:\n%s"), - e.response) + LOG.error(_LE("VCNS: Failed to get edge %(edge_id)s status: " + "Reason: %(reason)s"), + {'edge_id': edge_id, 'reason': e.response}) status_level = constants.RouterStatus.ROUTER_STATUS_ERROR try: desc = jsonutils.loads(e.response) @@ -232,7 +233,7 @@ class EdgeApplianceDriver(object): constants.VCNS_ERROR_CODE_EDGE_NOT_RUNNING): status_level = constants.RouterStatus.ROUTER_STATUS_DOWN except ValueError: - LOG.exception(e.response) + LOG.error(_LE('Error code not present. %s'), e.response) return status_level