]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Log error instead of exception trace
authorGary Kotton <gkotton@vmware.com>
Sat, 21 Nov 2015 07:29:46 +0000 (23:29 -0800)
committerGary Kotton <gkotton@vmware.com>
Mon, 23 Nov 2015 13:53:18 +0000 (05:53 -0800)
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

neutron/agent/ovsdb/impl_vsctl.py

index 306f5e486690721c31f98c0edbfc844a573bc504..21e3e63e673ada79577f6530130ca69592601dbe 100644 (file)
@@ -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']