Skip to content
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

Added handling for minion return exceptions containing the word "return" #50184

Merged

Conversation

ethanculler
Copy link
Contributor

What does this PR do?

This PR adds a check for the object type of the minion return to ensure we are dealing with a dict rather than a string containing 'return' (the key that the dict is looking for). This prevents a bad minion return from negatively impacting the master.

This bug was seen as far back as 2016.3 release

What issues does this PR fix or reference?

I didn't find any existing issues documenting this case, but there is certainly the chance I missed one.

Tests written?

No

Commits signed with GPG?

Yes

@ethanculler ethanculler requested a review from a team as a code owner October 23, 2018 21:07
@ghost ghost self-requested a review October 23, 2018 21:07
# step. Check if we have a string, log the issue and continue.
if isinstance(raw['data']['return'], six.string_types):
log.error("unexpected return from minion: %s", raw)
raw['data']['return'] = {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't think we want to overwrite this, because we still want to print out the exceptions from the minion return so people can troubleshoot issues.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. I was being a bit paranoid to make sure that it was in a state which would be thrown out if it was used somewhere else that I wasn't seeing.

@ethanculler ethanculler force-pushed the fix-minion-return-exception-with-return branch from 466c23e to a4e54d7 Compare October 23, 2018 22:24
@dwoz dwoz self-requested a review October 25, 2018 01:07
@brejoc
Copy link
Contributor

brejoc commented Oct 25, 2018

@ethanculler Any chance, you could provide a test for this? Otherwise those little details might break again in the future with code changes.

@ethanculler
Copy link
Contributor Author

@brejoc no problem.

@rallytime rallytime added the Needs-Testcase PR needs test cases written, or the issue is about a bug/feature that needs test cases label Oct 26, 2018
@gtmanfred gtmanfred merged commit b94a43b into saltstack:2017.7 Oct 27, 2018
@gtmanfred
Copy link
Contributor

Thanks @ethanculler and welcome to the saltstack contributors club 🍾

@gtmanfred
Copy link
Contributor

bah, we probably do still need a test for this. sorry, that is on me.

@ethanculler
Copy link
Contributor Author

@gtmanfred no worries. This week has been busy, but i'll get a test in for it in another PR (will link to this one) hopefully this weekend. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Testcase PR needs test cases written, or the issue is about a bug/feature that needs test cases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants