From f8883bead9dc1520763dbd566912e7bd584cd231 Mon Sep 17 00:00:00 2001 From: Erik Skultety Date: Thu, 18 May 2023 15:28:24 +0200 Subject: install: Introduce 'from_template_image' class method Analogically to from_vendor_image this class method prepares a VirtInstall runner object tailored to the user template base image scenario. Signed-off-by: Erik Skultety --- lcitool/install/install.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lcitool/install/install.py b/lcitool/install/install.py index a6ef147..61db4f2 100644 --- a/lcitool/install/install.py +++ b/lcitool/install/install.py @@ -73,6 +73,13 @@ class VirtInstall: runner = cls(name, facts) return cls._from_image(runner, config, image.path) + @classmethod + def from_template_image(cls, name, config, facts, template_path): + """ Shortcut constructor for a template image-based installation. """ + + runner = cls(name, facts) + return cls._from_image(runner, config, Path(template_path)) + def __init__(self, name, facts): """ Instantiates the virt-install installer backend. -- cgit v1.1