From c8588eddb6e14c98cbeaa64e1f32116e7a7d3b7a Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Fri, 23 May 2025 22:07:09 +0200 Subject: [PATCH] Fix(machines/create): always add 'deploy.targetHost' Rationale: not passing the value, is equivalent to deleting a value from the inventory store See: 'delete_by_path' deploy.targetHost has a default of null (None) --- pkgs/clan-cli/clan_cli/machines/create.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/clan-cli/clan_cli/machines/create.py b/pkgs/clan-cli/clan_cli/machines/create.py index c758b0216..0d86fcb3c 100644 --- a/pkgs/clan-cli/clan_cli/machines/create.py +++ b/pkgs/clan-cli/clan_cli/machines/create.py @@ -106,8 +106,7 @@ def create_machine(opts: CreateOptions, commit: bool = True) -> None: target_host = opts.target_host new_machine = opts.machine - if target_host: - new_machine["deploy"] = {"targetHost": target_host} + new_machine["deploy"] = {"targetHost": target_host} # type: ignore inventory_store = InventoryStore(opts.clan_dir) inventory = inventory_store.read()