mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-12-23 17:34:21 +03:00
unattended: Do not create a "unattended" dir
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. Reviewed-by: Cole Robinson <crobinso@redhat.com> Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
This commit is contained in:
parent
e58d765ae5
commit
98bd275969
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
import tempfile
|
||||||
|
|
||||||
import gi
|
import gi
|
||||||
gi.require_version('Libosinfo', '1.0')
|
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):
|
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):
|
if not os.path.exists(scratch):
|
||||||
os.makedirs(scratch, 0o751)
|
os.makedirs(scratch, 0o751)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user