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>
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))