From 7c399f15dfd163a3e6dac40c4d983657002a4a27 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Mon, 26 Sep 2022 08:18:11 +0000 Subject: [PATCH] meta: include path in RunnerInfo This is so that once we have a `RunnerInfo` we can directly run it without needed a back-reference to the index. --- osbuild/meta.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/osbuild/meta.py b/osbuild/meta.py index c5833a19..af1563d4 100644 --- a/osbuild/meta.py +++ b/osbuild/meta.py @@ -493,15 +493,16 @@ class RunnerInfo: specific distribution and version. """ - def __init__(self, distro: str, version: int) -> None: + def __init__(self, distro: str, version: int, path: str) -> None: self.distro = distro self.version = version + self.path = path @classmethod def from_path(cls, path: str): name = os.path.basename(path) distro, version = cls.parse_name(name) - return cls(distro, version) + return cls(distro, version, path) @staticmethod def parse_name(name: str) -> Tuple[str, int]: