From 0397504bdc812f0fe34d6eb355731581a290d6f8 Mon Sep 17 00:00:00 2001 From: ilia Nikiforov Date: Tue, 30 Jul 2024 16:03:15 -0500 Subject: [PATCH] add error messages for keys that are now required --- docker/config/excerpts/kimobjects.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/docker/config/excerpts/kimobjects.py b/docker/config/excerpts/kimobjects.py index dcf81d9..672d7ba 100644 --- a/docker/config/excerpts/kimobjects.py +++ b/docker/config/excerpts/kimobjects.py @@ -488,8 +488,11 @@ def matching_models(self): """ Specifies what types of subjects the runner can match with, as a list of strings. Required to be present. """ - if not self.kimspec: - return None + if not self.kimspec.get("matching-models"): + raise cf.MetadataKeyMissing( + "Required key 'matching-models' not found in " + "kimspec.edn file of {}".format(self.kim_code) + ) else: return self.kimspec["matching-models"] @@ -630,8 +633,11 @@ def run_compatibility(self): against portable models) as opposed to Tests that are specifically constructed to run against a particular subclass of SMs. """ - if not self.kimspec: - return None + if not self.kimspec.get("run-compatibility"): + raise cf.MetadataKeyMissing( + "Required key 'run-compatibility' not found in " + "kimspec.edn file of {}".format(self.kim_code) + ) else: return self.kimspec["run-compatibility"]