rename target_host to target_host_address
This commit is contained in:
parent
301a6b6a23
commit
6e57122da8
@ -73,7 +73,7 @@ def install_command(args: argparse.Namespace) -> None:
|
|||||||
kexec=args.kexec,
|
kexec=args.kexec,
|
||||||
)
|
)
|
||||||
machine = Machine(opts.machine, flake=opts.flake)
|
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)
|
install_nixos(machine, kexec=opts.kexec)
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ class Machine:
|
|||||||
return self._deployment_info
|
return self._deployment_info
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def target_host(self) -> str:
|
def target_host_address(self) -> str:
|
||||||
# deploymentAddress is deprecated.
|
# deploymentAddress is deprecated.
|
||||||
val = self.deployment_info.get("targetHost") or self.deployment_info.get(
|
val = self.deployment_info.get("targetHost") or self.deployment_info.get(
|
||||||
"deploymentAddress"
|
"deploymentAddress"
|
||||||
@ -57,8 +57,8 @@ class Machine:
|
|||||||
raise ClanError(msg)
|
raise ClanError(msg)
|
||||||
return val
|
return val
|
||||||
|
|
||||||
@target_host.setter
|
@target_host_address.setter
|
||||||
def target_host(self, value: str) -> None:
|
def target_host_address(self, value: str) -> None:
|
||||||
self.deployment_info["targetHost"] = value
|
self.deployment_info["targetHost"] = value
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -94,7 +94,7 @@ class Machine:
|
|||||||
@property
|
@property
|
||||||
def host(self) -> Host:
|
def host(self) -> Host:
|
||||||
return parse_deployment_address(
|
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:
|
def eval_nix(self, attr: str, refresh: bool = False) -> str:
|
||||||
|
@ -157,13 +157,13 @@ def get_all_machines(clan_dir: Path) -> HostGroup:
|
|||||||
for name, machine_data in machines.items():
|
for name, machine_data in machines.items():
|
||||||
machine = Machine(name=name, flake=clan_dir, deployment_info=machine_data)
|
machine = Machine(name=name, flake=clan_dir, deployment_info=machine_data)
|
||||||
try:
|
try:
|
||||||
machine.target_host
|
machine.target_host_address
|
||||||
except ClanError:
|
except ClanError:
|
||||||
ignored_machines.append(name)
|
ignored_machines.append(name)
|
||||||
continue
|
continue
|
||||||
host = parse_deployment_address(
|
host = parse_deployment_address(
|
||||||
name,
|
name,
|
||||||
host=machine.target_host,
|
host=machine.target_host_address,
|
||||||
meta={"machine": machine},
|
meta={"machine": machine},
|
||||||
)
|
)
|
||||||
hosts.append(host)
|
hosts.append(host)
|
||||||
@ -192,7 +192,7 @@ def update(args: argparse.Namespace) -> None:
|
|||||||
raise ClanError("Could not find clan flake toplevel directory")
|
raise ClanError("Could not find clan flake toplevel directory")
|
||||||
if len(args.machines) == 1 and args.target_host is not None:
|
if len(args.machines) == 1 and args.target_host is not None:
|
||||||
machine = Machine(name=args.machines[0], flake=args.flake)
|
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(
|
host = parse_deployment_address(
|
||||||
args.machines[0],
|
args.machines[0],
|
||||||
args.target_host,
|
args.target_host,
|
||||||
|
Loading…
Reference in New Issue
Block a user