From 1b63885fc59a366e7c3ba79644949ca7ab917fb6 Mon Sep 17 00:00:00 2001 From: Sloane Hertel Date: Wed, 18 Oct 2017 09:17:06 -0400 Subject: [PATCH] [cloud] Check instance public-IP property before transforming to dict (#31849) --- lib/ansible/modules/cloud/amazon/ec2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/cloud/amazon/ec2.py b/lib/ansible/modules/cloud/amazon/ec2.py index a09442f2898..d9ff6caf655 100644 --- a/lib/ansible/modules/cloud/amazon/ec2.py +++ b/lib/ansible/modules/cloud/amazon/ec2.py @@ -989,12 +989,12 @@ def enforce_count(module, ec2, vpc): # ensure all instances are dictionaries all_instances = [] for inst in instances: + warn_if_public_ip_assignment_changed(module, inst) + if not isinstance(inst, dict): inst = get_instance_info(inst) all_instances.append(inst) - warn_if_public_ip_assignment_changed(module, inst) - return (all_instances, instance_dict_array, changed_instance_ids, changed)