aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lava_dispatcher/action.py8
-rw-r--r--lava_dispatcher/test/test_devices.py3
2 files changed, 7 insertions, 4 deletions
diff --git a/lava_dispatcher/action.py b/lava_dispatcher/action.py
index 40f440ad5..a771ebfeb 100644
--- a/lava_dispatcher/action.py
+++ b/lava_dispatcher/action.py
@@ -503,8 +503,12 @@ class Action(object): # pylint: disable=too-many-instance-attributes,too-many-p
return False
# allow for commands which return no output
- if not log and allow_silent:
- return self.errors == []
+ if not log:
+ if allow_silent:
+ return self.errors == []
+ else:
+ self.logger.error("The command hasn't output anything")
+ raise JobError("Unable to call %s" % command_list)
else:
for line in log.split("\n"):
self.logger.debug('output: %s', line)
diff --git a/lava_dispatcher/test/test_devices.py b/lava_dispatcher/test/test_devices.py
index 5d3914a23..659d8b42e 100644
--- a/lava_dispatcher/test/test_devices.py
+++ b/lava_dispatcher/test/test_devices.py
@@ -220,8 +220,7 @@ class TestCommand(StdoutTestCase):
def test_silent(self):
fake = FakeAction()
command = 'true'
- log = fake.run_command(command.split(' '))
- self.assertEqual(log, '')
+ self.assertRaises(JobError, fake.run_command, command.split(' '))
self.assertEqual([], fake.errors)
def test_allow_silent(self):