Let's just use mktemp() as done in several other places and avoid the risk of having the content of the folder overwritten in case of parallel installations. Signed-off-by: Fabiano Fidêncio <fidencio@xxxxxxxxxx> --- virtinst/unattended.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/virtinst/unattended.py b/virtinst/unattended.py index 11de2fed..99907c1b 100644 --- a/virtinst/unattended.py +++ b/virtinst/unattended.py @@ -8,6 +8,7 @@ import logging import os +import tempfile import gi gi.require_version('Libosinfo', '1.0') @@ -264,7 +265,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") + scratch = tempfile.mktemp(dir=util.get_cache_dir()) if not os.path.exists(scratch): os.makedirs(scratch, 0o751) -- 2.21.0 _______________________________________________ virt-tools-list mailing list virt-tools-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/virt-tools-list