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

Fix ec2 pagination bug #2510

Merged
merged 1 commit into from
Mar 28, 2017
Merged

Fix ec2 pagination bug #2510

merged 1 commit into from
Mar 28, 2017

Conversation

JordonPhillips
Copy link
Member

@JordonPhillips JordonPhillips commented Mar 27, 2017

Resolves #2452

Fixes a bug where cli json input would get processed after ec2
auto pagination injection.

This was due to a subtle behavior of the event system. A handler
registered at the top level without any delimiters will always
be called after any events registered that do have delimiters
regarless of when or how they were registered.

The handler for --cli-input-json was registered against
'calling-command', and the handler for the ec2 pagination injection
was registered against 'calling-command.ec2.operation-name'. So then
even though the ec2 pagination injection was using register_last, it
was being called first.

The solution is to use 'calling-command.*' instead for the event
that --cli-input-json is registered against. This puts it in the same
pool as the other delimited handlers. This had the potential to break
other handlers depending on the existing ordering, but there were
very few registered to that event. Running the tests revealed no
issues, however.

There are four places where the event is used:

Two of those are the instances under question. Neither of the others
is dependent on --cli-input-json.

cc @kyleknap @jamesls @stealthycoin @dstufft

Resolves aws#2452

Fixes a bug where cli json input would get processed after ec2
auto pagination injection.

This was due to a subtle behavior of the event system. A handler
registered at the top level without any delimiters will always
be called *after* any events registered that do have delimiters
regarless of when or how they were registered.

The handler for --cli-input-json was registered against
'calling-command', and the handler for the ec2 pagination injection
was registered against 'calling-command.ec2.operation-name'. So then
even though the ec2 pagination injection was using register_last, it
was being called first.

The solution is to use 'calling-command.*' instead for the event
that --cli-input-json is registered against. This puts it in the same
pool as the other delimited handlers. This had the potential to break
other handlers depending on the existing ordering, but there were
very few registered to that event. Running the tests revealed no
issues, however.
@JordonPhillips JordonPhillips added the pr:needs-review This PR needs a review from a Member. label Mar 27, 2017
Copy link
Contributor

@kyleknap kyleknap left a comment

Choose a reason for hiding this comment

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

Looks good. 🚢

@JordonPhillips JordonPhillips merged commit 156f4a7 into aws:develop Mar 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:needs-review This PR needs a review from a Member.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants