-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Add state.show_states call. #44475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add state.show_states call. #44475
Conversation
|
@epcim Great addition! Thanks! Would you mind adding some unit tests to the PR for this new function? Thanks! |
salt/modules/state.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please break these out into three lines and change the double-quotes to single-quotes? Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could also use a .. versionadded:: Oxygen tag while you're editing this.
|
@garethgreenaway @epcim Integration tests might be a better choice here, IMHO. |
bc3551f to
1be19e9
Compare
|
I am not satisfied with the speed. Anyone know, how we could modify |
garethgreenaway
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me but @cachedout had requested integration tests in addition to or instead of the unit tests, so I'll defer.
|
Ah, yes. Integration tests would be good here @epcim. Please let us know if you need any help. |
|
@rallytime commented on Dec 5, 2017, 10:39 PM GMT+1:
I dont have any idea how to write tests properly for that, as what it does it's 1:1 code from low_sls call (if I remember + additional 5 lines of loop in order to pick sls. That code is supposed to be already tested by mentioned method. The only test I can imagine is that it returns a type list. As the in/out vlaues will be in the test call anyway modified to match. If you really need tests, can you post an update with some example that I could work on. Worth if you point out why it;s failing.. |
|
@epcim Thank you so much for adding these tests. I just checked and they're passing nicely. The other failures here are not related. @garethgreenaway Can you swing by here one more time when you get a moment? |
|
Squashed commit's in the last push.
|
|
Go Go Jenkins! |
|
Failures seems to me are not related to this patch.. |
This feature was added in PR saltstack#44475, which is presently only in the `develop` branch. Therefore, the `versionadded` tag should be `Fluorine` instead of `Oxygen`.
|
@epcim How this is different from |
|
@max-arnold In other words, if a state is included from another state, it will not be in |
What does this PR do?
list individual sls state's to be applied.
What issues does this PR fix or reference?
I found the function under this discussing: #6265
Thx, @cenkalti for writing it.
Tests written?
No
Commits signed with GPG?
Yes
How this can be used
One can get the list of these low state's to be applied and then query how many of them would perform a change on a node. For example, this is today script (https://github.com/salt-formulas/salt-formulas-scripts/blob/master/salt-state-apply-trend.sh) I am using.
(as up to now we don't have any statistics of this kind available (feel free to correct me)).