Skip to content

Commit

Permalink
Make group name mandatory
Browse files Browse the repository at this point in the history
name "None" will cause unexpected results, as all functions need the
group name.
  • Loading branch information
CarstenGrohmann committed Jun 22, 2023
1 parent 8d69308 commit 0dc4434
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions testinfra/modules/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class Group(Module):
"""Test unix group"""

def __init__(self, name=None):
def __init__(self, name):
self.name = name
super().__init__()

Expand All @@ -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
Expand Down

0 comments on commit 0dc4434

Please sign in to comment.