mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
Fix for pip state when user doesn't exist
This commit is contained in:
parent
d7338a0e79
commit
ee3d8924ac
1 changed files with 7 additions and 0 deletions
|
@ -839,6 +839,13 @@ def installed(
|
|||
ret["comment"] = "\n".join(comments)
|
||||
return ret
|
||||
|
||||
# If the user does not exist, stop here with error:
|
||||
if user and "user.info" in __salt__ and not __salt__["user.info"](user):
|
||||
# The user does not exists, exit with result set to False
|
||||
ret["result"] = False
|
||||
ret["comment"] = f"User {user} does not exist"
|
||||
return ret
|
||||
|
||||
# If a requirements file is specified, only install the contents of the
|
||||
# requirements file. Similarly, using the --editable flag with pip should
|
||||
# also ignore the "name" and "pkgs" parameters.
|
||||
|
|
Loading…
Add table
Reference in a new issue