clan-cli/ssh: rename Group -> HostGroup

This commit is contained in:
Jörg Thalheim
2023-08-10 12:30:33 +02:00
parent 12aab14ea5
commit b3a665cb19
3 changed files with 8 additions and 8 deletions

View File

@@ -534,7 +534,7 @@ def _worker(
results[idx] = HostResult(host, e)
class Group:
class HostGroup:
def __init__(self, hosts: List[Host]) -> None:
self.hosts = hosts
@@ -745,9 +745,9 @@ class Group:
self._reraise_errors(results)
return results
def filter(self, pred: Callable[[Host], bool]) -> "Group":
def filter(self, pred: Callable[[Host], bool]) -> "HostGroup":
"""Return a new Group with the results filtered by the predicate"""
return Group(list(filter(pred, self.hosts)))
return HostGroup(list(filter(pred, self.hosts)))
@overload

View File

@@ -1,6 +1,6 @@
import subprocess
from clan_cli.ssh import Group, Host, run
from clan_cli.ssh import Host, HostGroup, run
def test_run() -> None:
@@ -20,7 +20,7 @@ def test_run_failure() -> None:
assert False, "Command should have raised an error"
hosts = Group([Host("some_host")])
hosts = HostGroup([Host("some_host")])
def test_run_environment() -> None:

View File

@@ -4,12 +4,12 @@ import subprocess
from sshd import Sshd
from clan_cli.ssh import Group, Host, HostKeyCheck
from clan_cli.ssh import Host, HostGroup, HostKeyCheck
def deploy_group(sshd: Sshd) -> Group:
def deploy_group(sshd: Sshd) -> HostGroup:
login = pwd.getpwuid(os.getuid()).pw_name
return Group(
return HostGroup(
[
Host(
"127.0.0.1",