Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
bauen1 committed Oct 17, 2024
1 parent 2375eec commit b8e776f
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions pyinfra/facts/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,20 @@ def process(self, output):
return crons


class Users(FactBase):
class UserInfo(TypedDict):
name: str
comment: str
home: str
shell: str
group: str
groups: list[str]
uid: int
gid: int
lastlog: str
password: str


class Users(FactBase[dict[str, UserInfo]]):
"""
Returns a dictionary of users -> details.
Expand Down Expand Up @@ -543,7 +556,7 @@ def command(self) -> str:

default = dict

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

Expand Down

0 comments on commit b8e776f

Please sign in to comment.