Skip to content

Commit 1121554

Browse files
CarstenGrohmannphilpep
authored andcommitted
Make group name mandatory
name "None" will cause unexpected results, as all functions need the group name.
1 parent 076ff09 commit 1121554

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

testinfra/modules/group.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
class Group(Module):
1717
"""Test unix group"""
1818

19-
def __init__(self, name=None):
19+
def __init__(self, name):
2020
self.name = name
2121
super().__init__()
2222

@@ -28,9 +28,7 @@ def exists(self):
2828
True
2929
>>> host.group("nosuchgroup").exists
3030
False
31-
3231
"""
33-
3432
return self.run_expect([0, 2], "getent group %s", self.name).rc == 0
3533

3634
@property

0 commit comments

Comments
 (0)