Make the execute command a little less chatty
All we really care about is whether the command worked or not. So, leave the details about what happened for the debug log.
This commit is contained in:
parent
0ed189fb51
commit
3da9f69628
@ -36,7 +36,7 @@ def execute(command, cwd=None, exit=0):
|
||||
if cwd:
|
||||
original_dir = os.getcwd()
|
||||
os.chdir(cwd)
|
||||
LOG.info("Changed directory to %s", cwd)
|
||||
LOG.debug("Changed directory to %s", cwd)
|
||||
|
||||
LOG.info("Running: '%s'", command)
|
||||
process = subprocess.Popen(command,
|
||||
@ -48,12 +48,12 @@ def execute(command, cwd=None, exit=0):
|
||||
(out, err) = process.communicate()
|
||||
exitcode = process.wait()
|
||||
|
||||
LOG.info("Command exitted with rc: %s; STDOUT: %s; STDERR: %s" %
|
||||
LOG.debug("Command exitted with rc: %s; STDOUT: %s; STDERR: %s" %
|
||||
(exitcode, out, err))
|
||||
|
||||
if cwd:
|
||||
os.chdir(original_dir)
|
||||
LOG.info("Changed directory back to %s", original_dir)
|
||||
LOG.debug("Changed directory back to %s", original_dir)
|
||||
|
||||
if exitcode != exit:
|
||||
raise Exception("Failed to run '%s': rc: %d, out: '%s', err: '%s'" %
|
||||
|
Loading…
Reference in New Issue
Block a user