Include changes in the results when schedule.present state is run with test=True.

This commit is contained in:
Gareth J. Greenaway 2023-12-19 17:30:11 -08:00 committed by Daniel Wozniak
parent 05faca63ea
commit 9f5a1a7f4b
3 changed files with 3 additions and 1 deletions

1
changelog/65652.fixed.md Normal file
View file

@ -0,0 +1 @@
Include changes in the results when schedule.present state is run with test=True.

View file

@ -264,6 +264,7 @@ def present(name, **kwargs):
kwargs["test"] = True
result = __salt__["schedule.add"](name, **kwargs)
ret["comment"].append(result["comment"])
ret["changes"] = {name: "added"}
else:
result = __salt__["schedule.add"](name, **kwargs)
if not result["result"]:

View file

@ -220,7 +220,7 @@ def test_present():
ret = {
"name": "job1",
"result": True,
"changes": {},
"changes": {"job1": "added"},
"comment": "Job: test-schedule would be added to schedule.",
}
with patch.dict(schedule.__opts__, {"test": True}):