From dbd3194e9c0e5c2eb374f561dbfe255040912a6d Mon Sep 17 00:00:00 2001 From: James Laska Date: Wed, 19 Feb 2014 16:29:15 -0500 Subject: [PATCH] Resolves issue#6067 by allowing exact_count=0 --- library/cloud/ec2 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/library/cloud/ec2 b/library/cloud/ec2 index e590b40fbd..ab4a58a299 100644 --- a/library/cloud/ec2 +++ b/library/cloud/ec2 @@ -1035,7 +1035,7 @@ def main(): instance_profile_name = dict(), instance_ids = dict(type='list'), state = dict(default='present'), - exact_count = dict(type='int'), + exact_count = dict(type='int', default=None), count_tag = dict(), volumes = dict(type='list'), ) @@ -1071,11 +1071,11 @@ def main(): # Changed is always set to true when provisioning new instances if not module.params.get('image'): module.fail_json(msg='image parameter is required for new instance') - - if module.params.get('exact_count'): - (tagged_instances, instance_dict_array, new_instance_ids, changed) = enforce_count(module, ec2) - else: + + if module.params.get('exact_count') is None: (instance_dict_array, new_instance_ids, changed) = create_instances(module, ec2) + else: + (tagged_instances, instance_dict_array, new_instance_ids, changed) = enforce_count(module, ec2) module.exit_json(changed=changed, instance_ids=new_instance_ids, instances=instance_dict_array, tagged_instances=tagged_instances)