{vars,facts}/upload: fix ipv6 support
This commit is contained in:
@@ -37,7 +37,7 @@ def upload_secrets(machine: Machine) -> None:
|
||||
"--delete",
|
||||
"--chmod=D700,F600",
|
||||
f"{tempdir!s}/",
|
||||
f"{host.target}:{machine.secrets_upload_directory}/",
|
||||
f"{host.target_for_rsync}:{machine.secrets_upload_directory}/",
|
||||
],
|
||||
),
|
||||
log=Log.BOTH,
|
||||
|
||||
@@ -218,6 +218,13 @@ class Host:
|
||||
def target(self) -> str:
|
||||
return f"{self.user or 'root'}@{self.host}"
|
||||
|
||||
@property
|
||||
def target_for_rsync(self) -> str:
|
||||
host = self.host
|
||||
if ":" in host:
|
||||
host = f"[{host}]"
|
||||
return f"{self.user or 'root'}@{host}"
|
||||
|
||||
def _prefix_output(
|
||||
self,
|
||||
displayed_cmd: str,
|
||||
|
||||
@@ -38,7 +38,7 @@ def upload_secrets(machine: Machine) -> None:
|
||||
"--delete",
|
||||
"--chmod=D700,F600",
|
||||
f"{tempdir!s}/",
|
||||
f"{host.user}@{host.host}:{machine.secrets_upload_directory}/",
|
||||
f"{host.target_for_rsync}:{machine.secrets_upload_directory}/",
|
||||
],
|
||||
),
|
||||
log=Log.BOTH,
|
||||
|
||||
Reference in New Issue
Block a user