From 6e57122da897c21f627309b5c5715f7e51fad706 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 6 Feb 2024 15:54:12 +0100 Subject: [PATCH] rename target_host to target_host_address --- pkgs/clan-cli/clan_cli/machines/install.py | 2 +- pkgs/clan-cli/clan_cli/machines/machines.py | 8 ++++---- pkgs/clan-cli/clan_cli/machines/update.py | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/clan-cli/clan_cli/machines/install.py b/pkgs/clan-cli/clan_cli/machines/install.py index 7968dbed..36230b1f 100644 --- a/pkgs/clan-cli/clan_cli/machines/install.py +++ b/pkgs/clan-cli/clan_cli/machines/install.py @@ -73,7 +73,7 @@ def install_command(args: argparse.Namespace) -> None: kexec=args.kexec, ) machine = Machine(opts.machine, flake=opts.flake) - machine.target_host = opts.target_host + machine.target_host_address = opts.target_host install_nixos(machine, kexec=opts.kexec) diff --git a/pkgs/clan-cli/clan_cli/machines/machines.py b/pkgs/clan-cli/clan_cli/machines/machines.py index 13caca09..26d6e53e 100644 --- a/pkgs/clan-cli/clan_cli/machines/machines.py +++ b/pkgs/clan-cli/clan_cli/machines/machines.py @@ -47,7 +47,7 @@ class Machine: return self._deployment_info @property - def target_host(self) -> str: + def target_host_address(self) -> str: # deploymentAddress is deprecated. val = self.deployment_info.get("targetHost") or self.deployment_info.get( "deploymentAddress" @@ -57,8 +57,8 @@ class Machine: raise ClanError(msg) return val - @target_host.setter - def target_host(self, value: str) -> None: + @target_host_address.setter + def target_host_address(self, value: str) -> None: self.deployment_info["targetHost"] = value @property @@ -94,7 +94,7 @@ class Machine: @property def host(self) -> Host: return parse_deployment_address( - self.name, self.target_host, meta={"machine": self} + self.name, self.target_host_address, meta={"machine": self} ) def eval_nix(self, attr: str, refresh: bool = False) -> str: diff --git a/pkgs/clan-cli/clan_cli/machines/update.py b/pkgs/clan-cli/clan_cli/machines/update.py index 5db27efa..5d63e2a0 100644 --- a/pkgs/clan-cli/clan_cli/machines/update.py +++ b/pkgs/clan-cli/clan_cli/machines/update.py @@ -157,13 +157,13 @@ def get_all_machines(clan_dir: Path) -> HostGroup: for name, machine_data in machines.items(): machine = Machine(name=name, flake=clan_dir, deployment_info=machine_data) try: - machine.target_host + machine.target_host_address except ClanError: ignored_machines.append(name) continue host = parse_deployment_address( name, - host=machine.target_host, + host=machine.target_host_address, meta={"machine": machine}, ) hosts.append(host) @@ -192,7 +192,7 @@ def update(args: argparse.Namespace) -> None: raise ClanError("Could not find clan flake toplevel directory") if len(args.machines) == 1 and args.target_host is not None: machine = Machine(name=args.machines[0], flake=args.flake) - machine.target_host = args.target_host + machine.target_host_address = args.target_host host = parse_deployment_address( args.machines[0], args.target_host,