[virt-tools-list] [virt-manager PATCH 5/7] installer: deal with unattended files

Fabiano Fidêncio fidencio at redhat.com
Thu Mar 28 21:44:46 UTC 2019


Let's have a way to keep track of unattended files that are going to be
used when performing a unattended installation of a Windows guest so we
can clean them up whenever the installation is done.

Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
---
 virtinst/installer.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/virtinst/installer.py b/virtinst/installer.py
index 488ed324..0d60bb02 100644
--- a/virtinst/installer.py
+++ b/virtinst/installer.py
@@ -50,6 +50,7 @@ class Installer(object):
         self._install_initrd = None
         self._install_cdrom_device = None
         self._install_floppy_device = None
+        self._unattended_files = []
         self._defaults_are_set = False
 
         if location_kernel or location_initrd:
@@ -131,6 +132,10 @@ class Installer(object):
         self._install_floppy_device.path = None
         self._install_floppy_device.sync_path_props()
 
+    def _cleanup_unattended_files(self):
+        for f in self._unattended_files:
+            os.unlink(f)
+
     def _build_boot_order(self, guest, bootdev):
         bootorder = [bootdev]
 
-- 
2.20.1




More information about the virt-tools-list mailing list