From b0e7de3c8bb395cd2b4843b3016379cc299facd6 Mon Sep 17 00:00:00 2001 From: Pablo Ovelleiro Corral Date: Sun, 16 Feb 2025 16:22:37 +0100 Subject: [PATCH] Create directory --- pkgs/clan-cli/clan_cli/machines/update.py | 3 ++- pkgs/clan-cli/clan_cli/nix/__init__.py | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/clan-cli/clan_cli/machines/update.py b/pkgs/clan-cli/clan_cli/machines/update.py index cbe37709e..564a864bf 100644 --- a/pkgs/clan-cli/clan_cli/machines/update.py +++ b/pkgs/clan-cli/clan_cli/machines/update.py @@ -168,7 +168,8 @@ def deploy_machines(machines: list[Machine]) -> None: # Last output line (config store path) is printed to stdout instead of stderr lines = ret.stdout.splitlines() - if lines: print(lines[-1]) + if lines: + print(lines[-1]) if is_async_cancelled(): return diff --git a/pkgs/clan-cli/clan_cli/nix/__init__.py b/pkgs/clan-cli/clan_cli/nix/__init__.py index e4593b659..5c749951a 100644 --- a/pkgs/clan-cli/clan_cli/nix/__init__.py +++ b/pkgs/clan-cli/clan_cli/nix/__init__.py @@ -3,11 +3,11 @@ import logging import os from pathlib import Path from typing import Any -from clan_cli.locked_open import locked_open from clan_cli.cmd import run, run_no_stdout from clan_cli.dirs import nixpkgs_flake, nixpkgs_source from clan_cli.errors import ClanError +from clan_cli.locked_open import locked_open log = logging.getLogger(__name__) @@ -65,7 +65,8 @@ def nix_test_store() -> Path | None: if not os.environ.get("IN_NIX_SANDBOX"): return None if store: - with locked_open(Path(store) / "lockfile"): + Path.mkdir(Path(store), exist_ok=True) + with locked_open(filename=Path(store) / "lockfile", mode="a"): return Path(store) return None