Skip to content

Commit 932696f

Browse files
committed
facts: fix tests for getent based server.Groups
1 parent fe9bcd1 commit 932696f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

pyinfra/facts/server.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,9 @@ def command(self):
420420
# all groups / users, in which case only the local groups will be returned
421421
return "getent group"
422422

423+
def requires_command(self) -> str:
424+
return "getent"
425+
423426
default = list
424427

425428
def process(self, output) -> list[str]:

tests/facts/server.Groups/groups.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
2-
"command": "cat /etc/group",
2+
"command": "getent group",
3+
"requires_command": "getent",
34
"output": [
45
"lpadmin:x:114:vagrant",
56
"sambashare:x:115:vagrant",

0 commit comments

Comments
 (0)