buildroot: make var a positional argument

Commit d028ea5b16 introduced bug when introducing the `store`
argument to `Stage.run`, instead of passing `var=var`, i.e.
`var` is being passed as keyword argument, it is now being
passed as a positional one. Since the `path=/run/osbuild`
keyword argument comes before the `var=/var/tmp` argument,
`var` is now being passed as `path` instead of var.
Since `var` is always being passed in throughout the entire
codebase, make it a positional argument, and move it before
`path`.
Adapt the tests to pass `var` as positional argument.
This commit is contained in:
Christian Kellner 2021-02-11 20:46:33 +00:00
parent dd50387bbc
commit 749f59cc9a
2 changed files with 6 additions and 6 deletions

View file

@ -30,7 +30,7 @@ class TestBuildRoot(test.TestBase):
var.mkdir()
monitor = NullMonitor(sys.stderr.fileno())
with BuildRoot("/", runner, libdir, var=var) as root:
with BuildRoot("/", runner, libdir, var) as root:
r = root.run(["/usr/bin/true"], monitor)
self.assertEqual(r.returncode, 0)
@ -50,7 +50,7 @@ class TestBuildRoot(test.TestBase):
logfile = os.path.join(self.tmp.name, "log.txt")
with BuildRoot("/", runner, libdir, var=var) as root, \
with BuildRoot("/", runner, libdir, var) as root, \
open(logfile, "w") as log:
monitor = LogMonitor(log.fileno())
@ -73,7 +73,7 @@ class TestBuildRoot(test.TestBase):
data = "42. cats are superior to dogs"
monitor = NullMonitor(sys.stderr.fileno())
with BuildRoot("/", runner, libdir, var=var) as root:
with BuildRoot("/", runner, libdir, var) as root:
r = root.run(["/usr/bin/echo", data], monitor)
self.assertEqual(r.returncode, 0)
@ -93,7 +93,7 @@ class TestBuildRoot(test.TestBase):
scripts = os.path.join(self.locate_test_data(), "scripts")
monitor = NullMonitor(sys.stderr.fileno())
with BuildRoot("/", runner, libdir, var=var) as root:
with BuildRoot("/", runner, libdir, var) as root:
ro_binds = [f"{scripts}:/scripts"]
@ -127,7 +127,7 @@ class TestBuildRoot(test.TestBase):
scripts = os.path.join(self.locate_test_data(), "scripts")
monitor = NullMonitor(sys.stderr.fileno())
with BuildRoot("/", runner, libdir, var=var) as root:
with BuildRoot("/", runner, libdir, var) as root:
ro_binds = [f"{scripts}:/scripts"]