lava_create_jobs: generate_test_definitions: relax access to config dict
Relax the access to config dictionary by using get() method instead of
square brackets, in order to avoid to raise KeyError exceptions.
It's required for Musca support because the current code base is tightly
coupled with the existing supported platform like FVP and MPS2.
Some params/config doesn't exist for Musca, they apply only to FVP/MPS2,
and we want to gracefully continue if they're missing.
Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
Change-Id: I0cd16abcc3e6b41a9fcebfae418c7bfbf162bf36
diff --git a/lava_helper/lava_create_jobs.py b/lava_helper/lava_create_jobs.py
index a22f7c9..9c5e055 100755
--- a/lava_helper/lava_create_jobs.py
+++ b/lava_helper/lava_create_jobs.py
@@ -124,9 +124,9 @@
params = {
"device_type": config["device_type"],
"job_timeout": config["job_timeout"],
- "action_timeout": config["action_timeout"],
- "monitor_timeout": config["monitor_timeout"],
- "poweroff_timeout": config["poweroff_timeout"],
+ "action_timeout": config.get("action_timeout", ''),
+ "monitor_timeout": config.get("monitor_timeout", ''),
+ "poweroff_timeout": config.get("poweroff_timeout", ''),
"compiler": compiler,
"build_type": build_type,
"build_no": build_no,
@@ -147,12 +147,16 @@
"firmware_url": get_artifact_url(
artifact_store_url,
params,
- test_dict["binaries"]["firmware"],
+ test_dict.get("binaries").get("firmware"),
),
+ }
+ )
+ params.update(
+ {
"bootloader_url": get_artifact_url(
artifact_store_url,
params,
- test_dict["binaries"]["bootloader"],
+ test_dict.get("binaries").get("bootloader"),
),
}
)