start to name temporary directories in more places
This commit is contained in:
@@ -100,7 +100,7 @@ def flash_machine(
|
||||
secret_facts_store: SecretStoreBase = secret_facts_module.SecretStore(
|
||||
machine=machine
|
||||
)
|
||||
with TemporaryDirectory() as tmpdir_:
|
||||
with TemporaryDirectory(prefix="disko-install-") as tmpdir_:
|
||||
tmpdir = Path(tmpdir_)
|
||||
upload_dir = machine.secrets_upload_directory
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ def install_nixos(
|
||||
generate_facts([machine], None, False)
|
||||
generate_vars([machine], None, False)
|
||||
|
||||
with TemporaryDirectory() as tmpdir_:
|
||||
with TemporaryDirectory(prefix="nixos-install-") as tmpdir_:
|
||||
tmpdir = Path(tmpdir_)
|
||||
upload_dir_ = machine.secrets_upload_directory
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ def nix_eval(flags: list[str]) -> list[str]:
|
||||
]
|
||||
)
|
||||
if os.environ.get("IN_NIX_SANDBOX"):
|
||||
with tempfile.TemporaryDirectory() as nix_store:
|
||||
with tempfile.TemporaryDirectory(prefix="nix-store-") as nix_store:
|
||||
return [
|
||||
*default_flags,
|
||||
"--override-input",
|
||||
|
||||
@@ -121,7 +121,7 @@ def execute_generator(
|
||||
raise ClanError(msg) from e
|
||||
|
||||
env = os.environ.copy()
|
||||
with TemporaryDirectory() as tmp:
|
||||
with TemporaryDirectory(prefix="vars-") as tmp:
|
||||
tmpdir = Path(tmp)
|
||||
tmpdir_in = tmpdir / "in"
|
||||
tmpdir_prompts = tmpdir / "prompts"
|
||||
|
||||
@@ -129,11 +129,13 @@ def run_vm(
|
||||
cache.mkdir(exist_ok=True)
|
||||
|
||||
if cachedir is None:
|
||||
cache_tmp = stack.enter_context(TemporaryDirectory(dir=cache))
|
||||
cache_tmp = stack.enter_context(
|
||||
TemporaryDirectory(prefix="vm-cache-", dir=cache)
|
||||
)
|
||||
cachedir = Path(cache_tmp)
|
||||
|
||||
if socketdir is None:
|
||||
socket_tmp = stack.enter_context(TemporaryDirectory())
|
||||
socket_tmp = stack.enter_context(TemporaryDirectory(prefix="vm-sockets-"))
|
||||
socketdir = Path(socket_tmp)
|
||||
|
||||
# TODO: We should get this from the vm argument
|
||||
|
||||
Reference in New Issue
Block a user