From 1f9e4cf0f5bdca4ec7ed2d77e66a577aa713c96d Mon Sep 17 00:00:00 2001 From: Carsten Grohmann Date: Thu, 22 Jun 2023 14:17:32 +0200 Subject: [PATCH] Make group name mandatory name "None" will cause unexpected results, as all functions need the group name. --- testinfra/modules/group.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/testinfra/modules/group.py b/testinfra/modules/group.py index dd0e3fef..e87c7048 100644 --- a/testinfra/modules/group.py +++ b/testinfra/modules/group.py @@ -16,7 +16,7 @@ class Group(Module): """Test unix group""" - def __init__(self, name=None): + def __init__(self, name): self.name = name super().__init__() @@ -28,9 +28,7 @@ def exists(self): True >>> host.group("nosuchgroup").exists False - """ - return self.run_expect([0, 2], "getent group %s", self.name).rc == 0 @property