diff --git a/pkgs/clan-cli/clan_cli/ssh/__init__.py b/pkgs/clan-cli/clan_cli/ssh/__init__.py index 8b7165c80..6af8b4d10 100644 --- a/pkgs/clan-cli/clan_cli/ssh/__init__.py +++ b/pkgs/clan-cli/clan_cli/ssh/__init__.py @@ -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 diff --git a/pkgs/clan-cli/tests/test_ssh_local.py b/pkgs/clan-cli/tests/test_ssh_local.py index b0073101f..3eee6ce98 100644 --- a/pkgs/clan-cli/tests/test_ssh_local.py +++ b/pkgs/clan-cli/tests/test_ssh_local.py @@ -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: diff --git a/pkgs/clan-cli/tests/test_ssh_remote.py b/pkgs/clan-cli/tests/test_ssh_remote.py index 5885906a8..8df29e4ae 100644 --- a/pkgs/clan-cli/tests/test_ssh_remote.py +++ b/pkgs/clan-cli/tests/test_ssh_remote.py @@ -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",