draft support for parsing slot results and appending text#52187
Merged
Conversation
Contributor
Author
|
Tests have been added for the traverse and append functions. In thinking about this a little bit more, the parsing for the append function looks for a tilde character and appends everything afterwards. It is possible that the slot text itself could contain that character as you might have |
dwoz
approved these changes
Mar 20, 2019
twangboy
approved these changes
Mar 21, 2019
Contributor
Author
|
@DmitryKuzmenko you should take a look here as well |
DmitryKuzmenko
approved these changes
Apr 9, 2019
thatch45
approved these changes
Apr 9, 2019
mchugh19
pushed a commit
to mchugh19/salt
that referenced
this pull request
Oct 13, 2019
draft support for parsing slot results and appending text
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Extends slot syntax to support parsing resulting dictionaries and appending text. Note: the appending process only functions on slot results which are strings.
Next steps:
{u'shell': u'/bin/bash'}we could also force to json output if desired.What issues does this PR fix or reference?
#50462
#46771
Previous Behavior
Using
__slots__with modules which return dictionaries required custom modules to parse resultAlso, unable to append text
New Behavior
Support dictionary results by appending the slot function with period delimited dictionary keys to traverse
__slot__:salt:user.info(root).shellreturns/bin/bashSupport appending data by using a tilde delimiter followed by text
__slot__:salt:user.info(root).shell ~ /appended~returns/bin/bash/appended~Tests written?
Yes
Commits signed with GPG?
No