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 authored and philpep committed Jul 21, 2023
1 parent 076ff09 commit 1121554
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 1121554

Please sign in to comment.