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

Reduce scope of try except StopIteration wrapping #39596

Merged
merged 1 commit into from
Feb 23, 2017

Conversation

ticosax
Copy link
Contributor

@ticosax ticosax commented Feb 23, 2017

Aimed to reduce amount of code scope of try except where in one hand a 3 tuple were
returned and in the other hand a 2 tuple value.

@cachedout
There was 2 contradictory refactoring happening at different period.

74e1803
and
fe338ff

There were both correct taken separately but ended up being wrong when used together.
Something probably get lost during backporting. I didn't investigating further.

What does this PR do?

refactoring some code to simplify it.

Previous Behavior

sometimes a tuple of 2 items were returned while we expect 3 items.

Tests written?

No

Please review Salt's Contributing Guide for best practices.

Aimed to reduce amount of code where in one hand a 3 tuple were
returned and in the other hand a 2 tuple value.
nret.add(minion)
continue
else:
try:
m = next(six.iterkeys(ret))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the try except StopIteration was only intended for this line.
@cachedout better if you confirm yourself, since you added it in 1600f3e

Copy link
Contributor

Choose a reason for hiding this comment

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

I think you are correct here. I was being overly broad. This is better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thank you !

@cachedout cachedout merged commit 6ab4151 into saltstack:2016.11 Feb 23, 2017
@ticosax ticosax deleted the reduce-scope-catehed-exception branch February 24, 2017 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants