clan-cli: Fix bug where --target_host is getting ignored

This commit is contained in:
Qubasa
2024-10-05 18:50:40 +02:00
parent 9530d6aee7
commit 5967bb347c
7 changed files with 35 additions and 15 deletions

View File

@@ -176,6 +176,12 @@ class Host:
self.verbose_ssh = verbose_ssh
self.ssh_options = ssh_options
def __repr__(self) -> str:
return str(self)
def __str__(self) -> str:
return f"{self.user}@{self.host}" + str(self.port if self.port else "")
def _prefix_output(
self,
displayed_cmd: str,
@@ -547,6 +553,12 @@ class HostGroup:
def __init__(self, hosts: list[Host]) -> None:
self.hosts = hosts
def __repr__(self) -> str:
return str(self)
def __str__(self) -> str:
return f"HostGroup({self.hosts})"
def _run_local(
self,
cmd: str | list[str],