Skip to content

Commit fb92a8e

Browse files
committed
tasks.py: use parse_hosts from deploykit
1 parent a4b8b5c commit fb92a8e

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

tasks.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from pathlib import Path
66
from tempfile import TemporaryDirectory
77

8-
from deploykit import DeployGroup, DeployHost
8+
from deploykit import DeployGroup, DeployHost, parse_hosts
99
from invoke import Context, task
1010

1111
ROOT = Path(__file__).parent.resolve()
@@ -104,16 +104,14 @@ def docs_linkcheck(c: Context) -> None:
104104

105105

106106
def get_hosts(hosts: str) -> list[DeployHost]:
107-
deploy_hosts = []
108-
for host in hosts.split(","):
109-
if host.startswith("darwin"):
110-
deploy_hosts.append(
111-
DeployHost(f"{host}.nix-community.org", user="customer")
112-
)
113-
else:
114-
deploy_hosts.append(DeployHost(f"{host}.nix-community.org"))
115-
116-
return deploy_hosts
107+
g = parse_hosts(
108+
hosts=hosts,
109+
domain_suffix=".nix-community.org",
110+
)
111+
for i in g.hosts:
112+
if i.host.startswith("darwin"):
113+
i.user = "customer"
114+
return g.hosts
117115

118116

119117
def decrypt_host_key(flake_attr: str, tmpdir: str) -> None:

0 commit comments

Comments
 (0)