Skip to content

Commit

Permalink
Wrap a few more functions from salt.modules.state
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
  • Loading branch information
s0undt3ch committed Nov 4, 2022
1 parent 708bbde commit 83144c3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 4 additions & 1 deletion changelog/140.improvement.rst
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
Allow getting the state chunk by `__id__` on MultiStateResult
Several improvements to the state module wrappers:

* Allow getting the state chunk by `__id__` on MultiStateResult
* Wrap a few more functions from `salt.modules.state`
9 changes: 8 additions & 1 deletion src/saltfactories/utils/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,19 @@ def __setitem__(self, key, value):
wrapper which will return a more pythonic data structure to assert against.
"""
if key in (
"state.apply",
"state.high",
"state.highstate",
"state.low",
"state.single",
"state.sls",
"state.sls_id",
"state.template",
"state.template_str",
"state.test",
"state.top",
):
if key == "state.single":
if key in ("state.low", "state.single", "state.sls_id"):
wrapper_cls = StateResult
else:
wrapper_cls = MultiStateResult
Expand Down

0 comments on commit 83144c3

Please sign in to comment.