From 5008b7703f0943705e3acdbded9d3ecde5b2a8d1 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Wed, 10 Feb 2021 11:30:38 +0000 Subject: [PATCH] meta: ModuleInfo.{schema -> get_schema()} Change the `ModuleInfo.schema` propertly into a `get_schema` method call. This is in preparation to allow for different schemata versions to be supported. --- osbuild/meta.py | 5 ++--- test/mod/test_osbuild.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/osbuild/meta.py b/osbuild/meta.py index 11ad7aad..e40a4cc0 100644 --- a/osbuild/meta.py +++ b/osbuild/meta.py @@ -287,8 +287,7 @@ class ModuleInfo: self.desc = info.get("desc") self.opts = json.loads("{" + opts + "}") - @property - def schema(self): + def get_schema(self): schema = { "title": f"Pipeline {self.type}", "type": "object", @@ -485,7 +484,7 @@ class Index: elif klass in ["Assembler", "Input", "Source", "Stage"]: info = self.get_module_info(klass, name) if info: - schema = info.schema + schema = info.get_schema() else: raise ValueError(f"Unknown klass: {klass}") diff --git a/test/mod/test_osbuild.py b/test/mod/test_osbuild.py index 6d20efca..88c02d86 100644 --- a/test/mod/test_osbuild.py +++ b/test/mod/test_osbuild.py @@ -122,7 +122,7 @@ class TestDescriptions(unittest.TestCase): klass, name = module try: info = osbuild.meta.ModuleInfo.load(os.curdir, klass, name) - schema = osbuild.meta.Schema(info.schema, name) + schema = osbuild.meta.Schema(info.get_schema(), name) res = schema.check() if not res: err = "\n ".join(str(e) for e in res)