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

Multi-command salt calls return highest exit #47544

Merged
merged 2 commits into from Jun 1, 2018

Conversation

KaiSforza
Copy link
Contributor

What does this PR do?

Running a multiple command salt call will currently make salt think that
all of the minions returned with a failed state regardless of the return
values of the modules actually run. Right now it just returns the value
of retcode in the return dictionary if the return value is a
dictionary.

This checks if the retcode value is a dictionary itself, and then
returns the maximum return code that we recieved. This means that we
will continue to fail if the jobs did fail, but will return a zero if
all the jobs did so.

What issues does this PR fix or reference?

#18510

Previous Behavior

The salt summary would say that any multi-module salt call had failed, because it did not know how to parse returns with a dictionary retcode.

New Behavior

Salt now handles dictionary retcode values by taking the highest return value from multi-module call and using that to determine if it failed.

Tests written?

No

Commits signed with GPG?

Yes

@KaiSforza KaiSforza requested a review from a team as a code owner May 8, 2018 17:28
@ghost ghost self-requested a review May 8, 2018 17:28
@KaiSforza
Copy link
Contributor Author

Updated the default value from the .get() to be a dict so it actually has .values()

@KaiSforza
Copy link
Contributor Author

Fixed code lint check failure

18:16:33 salt/cli/salt.py:405: [C0325(superfluous-parens), ] Unnecessary parens after u'return' keyword

Copy link
Contributor

@isbm isbm left a comment

Choose a reason for hiding this comment

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

@rallytime the code looks good dealing with the different exit code types and structures 😉 but it would be still good to run a tests over it.

Running a multiple command salt call will currently make salt think that
all of the minions returned with a failed state regardless of the return
values of the modules actually run. Right now it just returns the value
of `retcode` in the return dictionary if the return value is a
dictionary.

This checks if the `retcode` value is a dictionary itself, and then
returns the maximum return code that we recieved. This means that we
will continue to fail if the jobs did fail, but will return a zero if
all the jobs did so.
@KaiSforza
Copy link
Contributor Author

Okay it looks like the tests are failing outside of my changes.

@terminalmage terminalmage merged commit 7fb420c into saltstack:develop Jun 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants