]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
misc.sh(): Don't log.exception() before raise
authorZack Cerza <zack@redhat.com>
Fri, 23 Oct 2015 22:00:06 +0000 (16:00 -0600)
committerZack Cerza <zack@redhat.com>
Fri, 23 Oct 2015 23:42:25 +0000 (17:42 -0600)
log.exception() logs the traceback, and raise will also cause it to be
logged. There's no need to have it logged twice; additionally, when sh()
was being called within a try/except clause we were confusingly logging
an expected failure. Callers can choose to log if they want.

Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/misc.py

index e5b6a7d88edf1915779d6eb8d4a89862001a7403..ea5b3ab7ed082e3deb10400d277770dcdc730811 100644 (file)
@@ -1311,7 +1311,6 @@ def sh(command):
         output = subprocess.check_output(command, stderr=subprocess.STDOUT,
                                          shell=True)
     except subprocess.CalledProcessError as e:
-        log.exception(command + " error " + str(e.output))
         raise e
     if output.strip():
         log.debug(command + " output " + str(output))