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.
This commit is contained in:
parent
3f18b9d682
commit
5008b7703f
2 changed files with 3 additions and 4 deletions
|
|
@ -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}")
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue