From 14d6bda763b15a9b3ec973cd50d8e4c4cd23138b Mon Sep 17 00:00:00 2001 From: kiri Date: Mon, 28 Oct 2013 21:35:57 +0900 Subject: [PATCH] add NoneType check. --- cloud/ec2_elb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cloud/ec2_elb b/cloud/ec2_elb index 2ea64ebc1b5..107eaf807a1 100644 --- a/cloud/ec2_elb +++ b/cloud/ec2_elb @@ -300,10 +300,11 @@ def main(): elb_man = ElbManager(module, instance_id, ec2_elbs, aws_access_key, aws_secret_key, region=region) - for elb in ec2_elbs: - if not elb_man.exists(elb): - msg="ELB %s does not exist" % elb - module.fail_json(msg=msg) + if ec2_elbs is not None: + for elb in ec2_elbs: + if not elb_man.exists(elb): + msg="ELB %s does not exist" % elb + module.fail_json(msg=msg) if module.params['state'] == 'present': elb_man.register(wait, enable_availability_zone)