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)
This commit is contained in:
Johannes Kirschbauer
2025-05-23 22:07:09 +02:00
parent a7f4927e0c
commit c8588eddb6

View File

@@ -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()