pipeline: refactor args for add_stage
All tests and invocations of `add_stage` actually pass a valid options dictionary. Thefore move the `options` args before the `sources` arg and remove the default value (`None`).
This commit is contained in:
parent
963a22ac9d
commit
698635171c
4 changed files with 7 additions and 7 deletions
|
|
@ -64,7 +64,7 @@ def load_pipeline(description: Dict, sources_options: Dict, result: List[Pipelin
|
|||
pipeline = Pipeline(runner, build_pipeline and build_pipeline.tree_id)
|
||||
|
||||
for s in description.get("stages", []):
|
||||
pipeline.add_stage(s["name"], sources_options, s.get("options", {}))
|
||||
pipeline.add_stage(s["name"], s.get("options", {}), sources_options)
|
||||
|
||||
a = description.get("assembler")
|
||||
if a:
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ class Pipeline:
|
|||
def output_id(self):
|
||||
return self.assembler.id if self.assembler else None
|
||||
|
||||
def add_stage(self, name, sources_options=None, options=None):
|
||||
def add_stage(self, name, options, sources_options=None):
|
||||
stage = Stage(name, sources_options, self.build, self.tree_id, options or {})
|
||||
self.stages.append(stage)
|
||||
if self.assembler:
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ class TestMonitor(unittest.TestCase):
|
|||
# Checks the basic functioning of the LogMonitor
|
||||
runner = detect_host_runner()
|
||||
pipeline = osbuild.Pipeline(runner=runner)
|
||||
pipeline.add_stage("org.osbuild.noop", {}, {
|
||||
pipeline.add_stage("org.osbuild.noop", {
|
||||
"isthisthereallife": False
|
||||
})
|
||||
pipeline.set_assembler("org.osbuild.noop")
|
||||
|
|
@ -88,10 +88,10 @@ class TestMonitor(unittest.TestCase):
|
|||
# Checks the monitoring API is called properly from the pipeline
|
||||
runner = detect_host_runner()
|
||||
pipeline = osbuild.Pipeline(runner=runner)
|
||||
pipeline.add_stage("org.osbuild.noop", {}, {
|
||||
pipeline.add_stage("org.osbuild.noop", {
|
||||
"isthisthereallife": False
|
||||
})
|
||||
pipeline.add_stage("org.osbuild.noop", {}, {
|
||||
pipeline.add_stage("org.osbuild.noop", {
|
||||
"isthisjustfantasy": True
|
||||
})
|
||||
pipeline.set_assembler("org.osbuild.noop")
|
||||
|
|
|
|||
|
|
@ -80,10 +80,10 @@ class TestDescriptions(unittest.TestCase):
|
|||
|
||||
def test_pipeline(self):
|
||||
build = osbuild.Pipeline("org.osbuild.test")
|
||||
build.add_stage("org.osbuild.test", {}, {"one": 1})
|
||||
build.add_stage("org.osbuild.test", {"one": 1})
|
||||
|
||||
pipeline = osbuild.Pipeline("org.osbuild.test", build.tree_id)
|
||||
pipeline.add_stage("org.osbuild.test", {}, {"one": 2})
|
||||
pipeline.add_stage("org.osbuild.test", {"one": 2})
|
||||
pipeline.set_assembler("org.osbuild.test")
|
||||
|
||||
manifest = osbuild.Manifest([build, pipeline], {})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue