Skip to content

Commit

Permalink
Include changes in the results when schedule.present state is run wit…
Browse files Browse the repository at this point in the history
…h test=True.
  • Loading branch information
garethgreenaway authored and dwoz committed Dec 21, 2023
1 parent 05faca6 commit 9f5a1a7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog/65652.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Include changes in the results when schedule.present state is run with test=True.
1 change: 1 addition & 0 deletions salt/states/schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]:
Expand Down
2 changes: 1 addition & 1 deletion tests/pytests/unit/states/test_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}):
Expand Down

0 comments on commit 9f5a1a7

Please sign in to comment.