mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Do not fail on checking user/group in test mode
This commit is contained in:
parent
8c591700ce
commit
84e90b20bf
1 changed files with 5 additions and 0 deletions
|
@ -379,6 +379,11 @@ def _check_user(user, group):
|
|||
gid = __salt__["file.group_to_gid"](group)
|
||||
if gid == "":
|
||||
err += "Group {} is not available".format(group)
|
||||
if err and __opts__["test"]:
|
||||
# Write the warning with error message, but prevent failing,
|
||||
# in case of applying the state in test mode.
|
||||
log.warning(err)
|
||||
return ""
|
||||
return err
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue