[virt-tools-list] [virt-manager PATCH 02/12] unattended: Use make_unattended_cache_dir()

Fabiano Fidêncio fidencio at redhat.com
Thu Jun 6 14:11:33 UTC 2019


Let's use this util's method and avoid creating the cache dir by our
own.

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

diff --git a/virtinst/unattended.py b/virtinst/unattended.py
index 11de2fed..e79c1a47 100644
--- a/virtinst/unattended.py
+++ b/virtinst/unattended.py
@@ -264,10 +264,7 @@ def prepare_install_script(guest, unattended_data, url=None, os_media=None):
 
 
 def generate_install_script(script):
-    scratch = os.path.join(util.get_cache_dir(), "unattended")
-    if not os.path.exists(scratch):
-        os.makedirs(scratch, 0o751)
-
+    scratch = util.make_unattended_cache_dir()
     script.generate_output(Gio.File.new_for_path(scratch))
     path = os.path.join(scratch, script.get_expected_filename())
     cmdline = script.generate_cmdline()
-- 
2.21.0




More information about the virt-tools-list mailing list