From 875c8e4f3e514d4c571e2d4b58e605caddb936d3 Mon Sep 17 00:00:00 2001 From: s-hertel Date: Wed, 26 Jul 2017 12:24:56 -0400 Subject: [PATCH] ensure stickiness expiration is an int before comparison --- lib/ansible/modules/cloud/amazon/elb_classic_lb.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/amazon/elb_classic_lb.py b/lib/ansible/modules/cloud/amazon/elb_classic_lb.py index c5df06deeff..a524f8af011 100644 --- a/lib/ansible/modules/cloud/amazon/elb_classic_lb.py +++ b/lib/ansible/modules/cloud/amazon/elb_classic_lb.py @@ -1063,7 +1063,10 @@ class ElbManager(object): 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 + except ValueError: + self.module.fail_json(msg='expiration must be set to an integer') policy_attrs = { 'type': policy_type,