From: Gary Kotton Date: Sat, 21 Nov 2015 07:29:46 +0000 (-0800) Subject: Log error instead of exception trace X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=3858846770fcb51c2302abd4e5fdba1e12e663a7;p=openstack-build%2Fneutron-build.git Log error instead of exception trace In impl_vsctl we rather use LOG.error instead of LOG.exception. In these case the exception trace did not provide any valuable information. Change-Id: Ia02f000d460b3aee72a31e9963e5d0e0d4c68315 Closes-bug: #1518429 --- diff --git a/neutron/agent/ovsdb/impl_vsctl.py b/neutron/agent/ovsdb/impl_vsctl.py index 306f5e486..21e3e63e6 100644 --- a/neutron/agent/ovsdb/impl_vsctl.py +++ b/neutron/agent/ovsdb/impl_vsctl.py @@ -61,11 +61,12 @@ class Transaction(ovsdb.Transaction): # We log our own errors, so never have utils.execute do it return utils.execute(full_args, run_as_root=True, log_fail_as_error=False).rstrip() - except Exception: + except Exception as e: with excutils.save_and_reraise_exception() as ctxt: if self.log_errors: - LOG.exception(_LE("Unable to execute %(cmd)s."), - {'cmd': full_args}) + LOG.error(_LE("Unable to execute %(cmd)s. " + "Exception: %(exception)s"), + {'cmd': full_args, 'exception': e}) if not self.check_error: ctxt.reraise = False @@ -119,11 +120,13 @@ class DbCommand(BaseCommand): try: json = jsonutils.loads(raw_result) - except (ValueError, TypeError): + except (ValueError, TypeError) as e: # This shouldn't happen, but if it does and we check_errors # log and raise. with excutils.save_and_reraise_exception(): - LOG.exception(_LE("Could not parse: %s"), raw_result) + LOG.error(_LE("Could not parse: %(raw_result)s. " + "Exception: %(exception)s"), + {'raw_result': raw_result, 'exception': e}) headings = json['headings'] data = json['data']