diff options
author | Neil Williams <neil.williams@linaro.org> | 2018-07-20 07:03:57 +0100 |
---|---|---|
committer | Neil Williams <neil.williams@linaro.org> | 2018-07-20 08:08:52 +0100 |
commit | a6c34e83f18cd7adce27756dfe10b8439fbee965 (patch) | |
tree | bcae175603c75d061b8f346c555da789298118b4 | |
parent | 0892c092957f55f5ddebdced896e68616d5e1077 (diff) |
Output a validation error for missing commands:
If a misconfigured device lacks any commands: then
connection.serial needs to report a validate() error
instead of the current traceback.
Change-Id: I6e3769189bc3388e6efd693356ec3b3cdcf2b6e2
-rw-r--r-- | lava_dispatcher/connections/serial.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lava_dispatcher/connections/serial.py b/lava_dispatcher/connections/serial.py index 6468d1e33..0a902a8e0 100644 --- a/lava_dispatcher/connections/serial.py +++ b/lava_dispatcher/connections/serial.py @@ -63,6 +63,9 @@ class ConnectDevice(Action): def validate(self): super().validate() matched = False + if 'commands' not in self.job.device: + self.errors = "Invalid device configuration - missing 'commands'" + return if 'connect' in self.job.device['commands']: # deprecated but allowed for primary if self.primary: |