osbuild: use load function via the format module
Instead of importing the load, load_build functions into the osbuild namespace and using it via that, use the load function via the module that provides them, i.e. the formats.v1 module.
This commit is contained in:
parent
b65211a94d
commit
0b6f36158d
4 changed files with 4 additions and 7 deletions
|
|
@ -8,14 +8,11 @@ The utility module `osbuild.util` provides access to common functionality
|
|||
independent of osbuild but used across the osbuild codebase.
|
||||
"""
|
||||
|
||||
from .formats.v1 import load, load_build
|
||||
from .pipeline import Assembler, Pipeline, Stage
|
||||
|
||||
|
||||
__all__ = [
|
||||
"Assembler",
|
||||
"load",
|
||||
"load_build",
|
||||
"Pipeline",
|
||||
"Stage",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ def osbuild_cli():
|
|||
pipeline = manifest.get("pipeline", {})
|
||||
sources_options = manifest.get("sources", {})
|
||||
|
||||
pipeline = osbuild.load(pipeline, sources_options)
|
||||
pipeline = fmt.load(pipeline, sources_options)
|
||||
|
||||
if args.checkpoint:
|
||||
missed = mark_checkpoints(pipeline, args.checkpoint)
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class TestDescriptions(unittest.TestCase):
|
|||
]
|
||||
for pipeline in cases:
|
||||
with self.subTest(pipeline):
|
||||
self.assertEqual(osbuild.load(pipeline, {}).description(), {})
|
||||
self.assertEqual(fmt.load(pipeline, {}).description(), {})
|
||||
|
||||
def test_stage(self):
|
||||
name = "org.osbuild.test"
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import sys
|
|||
import tempfile
|
||||
import unittest
|
||||
|
||||
import osbuild
|
||||
from osbuild.formats import v1 as fmt
|
||||
from osbuild.util import linux
|
||||
|
||||
|
||||
|
|
@ -356,7 +356,7 @@ class OSBuild(contextlib.AbstractContextManager):
|
|||
manifest_pipeline = manifest_json.get("pipeline", {})
|
||||
manifest_sources = manifest_json.get("sources", {})
|
||||
|
||||
manifest_parsed = osbuild.load(manifest_pipeline, manifest_sources)
|
||||
manifest_parsed = fmt.load(manifest_pipeline, manifest_sources)
|
||||
return manifest_parsed.tree_id
|
||||
|
||||
@contextlib.contextmanager
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue