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

elb_classic_lb: ensure stickiness expiration is an int before comparison - fixes #27309 #27328

Merged
merged 1 commit into from
Aug 9, 2017

Conversation

s-hertel
Copy link
Contributor

@s-hertel s-hertel commented Jul 26, 2017

SUMMARY

Expiration should be an int. Fixes #27309

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

lib/ansible/modules/cloud/amazon/elb_classic_lb.py

ANSIBLE VERSION
2.4.0

@s-hertel s-hertel force-pushed the stickiness_0 branch 2 times, most recently from 37ab78a to bf682aa Compare July 26, 2017 16:34
@ansibot
Copy link
Contributor

ansibot commented Jul 26, 2017

@ansibot ansibot added affects_2.4 This issue/PR affects Ansible v2.4 aws bugfix_pull_request cloud committer_review In order to be merged, this PR must follow the certified review workflow. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. labels Jul 26, 2017
@@ -1063,7 +1063,10 @@ def select_stickiness_policy(self):
if 'expiration' not in self.stickiness:
self.module.fail_json(msg='expiration must be set when type is loadbalancer')

expiration = self.stickiness['expiration'] if self.stickiness['expiration'] is not 0 else None
try:
expiration = self.stickiness['expiration'] if int(self.stickiness['expiration']) else None
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you need expiration to be an int type as well or is it okay if it is a string repesentation (like: "10" )

Copy link
Contributor

Choose a reason for hiding this comment

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

ie: if self.stickiness['expiration'] is the string "10", the change being made does the comparison of self.stickiness['expiration'] as the int 10, but the variable expiration is set to the string "10".

Copy link
Contributor Author

@s-hertel s-hertel Jul 27, 2017

Choose a reason for hiding this comment

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

Thanks for the review. String representation works as expected. The comparison casts them to strings.

@abadger abadger removed the needs_triage Needs a first human triage before being processed. label Jul 26, 2017
@abadger
Copy link
Contributor

abadger commented Jul 27, 2017 via email

@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Aug 3, 2017
@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Aug 8, 2017
@abadger abadger merged commit 875c8e4 into ansible:devel Aug 9, 2017
@abadger
Copy link
Contributor

abadger commented Aug 9, 2017

merged to devel. Feel free to cherry-pick if you think it's needed in 2.3.x.

@s-hertel s-hertel deleted the stickiness_0 branch September 28, 2017 19:28
@ansibot ansibot added bug This issue/PR relates to a bug. and removed bugfix_pull_request labels Mar 6, 2018
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.4 This issue/PR affects Ansible v2.4 aws bug This issue/PR relates to a bug. cloud committer_review In order to be merged, this PR must follow the certified review workflow. module This issue/PR relates to a module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ec2_elb_lb: Numeric parameter stickiness['expiration'] passed to module as string and fails test
4 participants