From 98d9dd080c63258c32c3ae10f11b51e99718b636 Mon Sep 17 00:00:00 2001 From: Marc Bonnici Date: Wed, 11 Apr 2018 17:51:04 +0100 Subject: [PATCH] config/execution: Raise better error if no workloads specified. If WA is ran without any workloads being specified, previously an index error was thrown, now check that at least one global workload has been specified and if not, provide a more helpful error message. --- wa/framework/configuration/parsers.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wa/framework/configuration/parsers.py b/wa/framework/configuration/parsers.py index d959a8c8..22f8765c 100644 --- a/wa/framework/configuration/parsers.py +++ b/wa/framework/configuration/parsers.py @@ -87,6 +87,10 @@ class AgendaParser(object): self._populate_and_validate_config(state, raw, source) sections = self._pop_sections(raw) global_workloads = self._pop_workloads(raw) + if not global_workloads: + msg = 'No jobs avaliable. Please ensure you have specified at '\ + 'least one workload to run.' + raise ConfigError(msg) if raw: msg = 'Invalid top level agenda entry(ies): "{}"'