Skip to content

Commit b8e776f

Browse files
committed
WIP
1 parent 2375eec commit b8e776f

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

pyinfra/facts/server.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,20 @@ def process(self, output):
506506
return crons
507507

508508

509-
class Users(FactBase):
509+
class UserInfo(TypedDict):
510+
name: str
511+
comment: str
512+
home: str
513+
shell: str
514+
group: str
515+
groups: list[str]
516+
uid: int
517+
gid: int
518+
lastlog: str
519+
password: str
520+
521+
522+
class Users(FactBase[dict[str, UserInfo]]):
510523
"""
511524
Returns a dictionary of users -> details.
512525
@@ -543,7 +556,7 @@ def command(self) -> str:
543556

544557
default = dict
545558

546-
def process(self, output):
559+
def process(self, output: Iterable[str]) -> dict[str, UserInfo]:
547560
users = {}
548561
rex = r"[A-Z][a-z]{2} [A-Z][a-z]{2} {1,2}\d+ .+$"
549562

0 commit comments

Comments
 (0)