add more custom prefixes for temporary directories

This commit is contained in:
Jörg Thalheim
2024-10-01 20:43:04 +02:00
parent 93b1391e4c
commit 2a2818d050
4 changed files with 4 additions and 4 deletions

View File

@@ -194,7 +194,7 @@ def generate_facts(
prompt: Callable[[str, str], str] = prompt_func, prompt: Callable[[str, str], str] = prompt_func,
) -> bool: ) -> bool:
was_regenerated = False was_regenerated = False
with TemporaryDirectory() as tmp: with TemporaryDirectory(prefix="facts-generate-") as tmp:
tmpdir = Path(tmp) tmpdir = Path(tmp)
for machine in machines: for machine in machines:

View File

@@ -19,7 +19,7 @@ def upload_secrets(machine: Machine) -> None:
if secret_facts_store.update_check(): if secret_facts_store.update_check():
log.info("Secrets already up to date") log.info("Secrets already up to date")
return return
with TemporaryDirectory() as tempdir: with TemporaryDirectory(prefix="facts-upload-") as tempdir:
secret_facts_store.upload(Path(tempdir)) secret_facts_store.upload(Path(tempdir))
host = machine.target_host host = machine.target_host

View File

@@ -86,7 +86,7 @@ def create_machine(opts: CreateOptions) -> None:
) )
raise ClanError(msg, description=description) raise ClanError(msg, description=description)
with TemporaryDirectory() as tmpdir: with TemporaryDirectory(prefix="machine-template-") as tmpdir:
tmpdirp = Path(tmpdir) tmpdirp = Path(tmpdir)
command = nix_command( command = nix_command(
[ [

View File

@@ -19,7 +19,7 @@ def upload_secrets(machine: Machine) -> None:
if secret_store.update_check(): if secret_store.update_check():
log.info("Secrets already up to date") log.info("Secrets already up to date")
return return
with TemporaryDirectory() as tempdir: with TemporaryDirectory(prefix="vars-upload-") as tempdir:
secret_store.upload(Path(tempdir)) secret_store.upload(Path(tempdir))
host = machine.target_host host = machine.target_host