summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Williams <neil.williams@linaro.org>2016-09-06 08:35:00 (GMT)
committerNeil Williams <neil.williams@linaro.org>2016-09-06 12:50:02 (GMT)
commit4bb2e5f4ca06531d321bdcd96395a3f9b44c6410 (patch)
tree9d28db3661a6fbaffd7379f1ed21c3cc1140531c
parentd1d216895485739007b9b626f9c6d3b2ba6ce5f1 (diff)
downloadlava-dispatcher-4bb2e5f4ca06531d321bdcd96395a3f9b44c6410.tar.gz
lava-dispatcher-4bb2e5f4ca06531d321bdcd96395a3f9b44c6410.tar.xz
Always log the command to be run beforehand.staging
Make it more logical when viewing the log files instead of just the start: action_name (timeout) default message. Drop unused import. Change-Id: Ib68be12bd19f35869986bab3b09cc9e521665264 (cherry picked from commit 8db974a7accd35a5905342e290ab7971b2a251ea)
-rw-r--r--lava_dispatcher/pipeline/action.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/lava_dispatcher/pipeline/action.py b/lava_dispatcher/pipeline/action.py
index 4bfb006..83d3ca6 100644
--- a/lava_dispatcher/pipeline/action.py
+++ b/lava_dispatcher/pipeline/action.py
@@ -20,7 +20,6 @@
import re
import logging
-import os
import sys
import copy
import time
@@ -648,6 +647,7 @@ class Action(object): # pylint: disable=too-many-instance-attributes
log = None
# nice is assumed to always exist (coreutils)
command_list.insert(0, 'nice')
+ self.logger.info("%s", ' '.join(command_list))
try:
log = subprocess.check_output(command_list, stderr=subprocess.STDOUT)
log = log.decode('utf-8')
@@ -679,10 +679,9 @@ class Action(object): # pylint: disable=too-many-instance-attributes
# allow for commands which return no output
if not log and allow_silent:
- self.logger.debug('command %s', command_list)
return self.errors == []
else:
- self.logger.debug('command %s output %s', command_list, log)
+ self.logger.debug('command output %s', log)
return log
def call_protocols(self):