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

Projects
None yet
6 participants
@ethanculler
Copy link
Contributor

commented Oct 23, 2018

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 saltstack/team-core as a code owner Oct 23, 2018

@salt-jenkins salt-jenkins requested a review from saltstack/team-suse Oct 23, 2018

# 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'] = {}

This comment has been minimized.

Copy link
@gtmanfred

gtmanfred Oct 23, 2018

Contributor

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.

This comment has been minimized.

Copy link
@ethanculler

ethanculler Oct 23, 2018

Author Contributor

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 ethanculler:fix-minion-return-exception-with-return branch from 466c23e to a4e54d7 Oct 23, 2018

@rallytime rallytime requested a review from gtmanfred Oct 24, 2018

@dwoz dwoz self-requested a review Oct 25, 2018

@brejoc

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Contributor Author

commented Oct 25, 2018

@brejoc no problem.

@dwoz

dwoz approved these changes Oct 26, 2018

@gtmanfred gtmanfred merged commit b94a43b into saltstack:2017.7 Oct 27, 2018

8 of 10 checks passed

jenkins/pr/py2-windows-2016 The py2-windows-2016 job has failed
Details
jenkins/pr/py3-windows-2016 The py3-windows-2016 job has failed
Details
WIP Ready for review
Details
continuous-integration/jenkins/pr-merge This commit looks good
Details
jenkins/pr/docs The docs job has passed
Details
jenkins/pr/lint The lint job has passed
Details
jenkins/pr/py2-centos-7 The py2-centos-7 job has passed
Details
jenkins/pr/py2-ubuntu-1604 The py2-ubuntu-1604 job has passed
Details
jenkins/pr/py3-centos-7 The py3-centos-7 job has passed
Details
jenkins/pr/py3-ubuntu-1604 The py3-ubuntu-1604 job has passed
Details
@gtmanfred

This comment has been minimized.

Copy link
Contributor

commented Oct 27, 2018

Thanks @ethanculler and welcome to the saltstack contributors club 🍾

@gtmanfred

This comment has been minimized.

Copy link
Contributor

commented Oct 27, 2018

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

@ethanculler

This comment has been minimized.

Copy link
Contributor Author

commented Oct 27, 2018

@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
You can’t perform that action at this time.