Make the "change" parameter optional for add_policy and update_policy methods #211
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bugs this should fix:
#209 - policy.update(...) breaks with changePercent-based policies
#207 - really make it possible to use desiredCapacity now. the previous branch didn't work because change was still required, which conflicts.
I somewhat significantly refactored the implementation of update_policy, since the boolean logic needed to be a bit more strict about when it would use data from the policy and when it would use data passed in. I wrote several unit tests for the behavior of updating policies between different types of change (change, changePercent, and desiredCapacity), as well as tests for maintaining that state when the update_policy call wasn't explicitly passed any change-related parameters.
In addition to the unit tests I've done some ad-hoc tests against the production Auto Scale service.