From 045b084d34c08aee910cee2362cf209fd80d3c6d Mon Sep 17 00:00:00 2001 From: isethi Date: Tue, 31 Jul 2012 19:52:49 +0000 Subject: Changes default behavior of ec2 Changes the default behaviour of create instance min/max count logic in ec2 to match the default behavior of OS API Fixes bug 989799 Change-Id: I1aa42c7d47674ce68442367fab487152b3e7fa67 --- nova/api/ec2/cloud.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'nova/api') diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py index 80f3a5012..834b5b7e2 100644 --- a/nova/api/ec2/cloud.py +++ b/nova/api/ec2/cloud.py @@ -1163,7 +1163,7 @@ class CloudController(object): return {'return': "true"} def run_instances(self, context, **kwargs): - max_count = int(kwargs.get('max_count', 1)) + min_count = int(kwargs.get('min_count', 1)) if kwargs.get('kernel_id'): kernel = self._get_image(context, kwargs['kernel_id']) kwargs['kernel_id'] = ec2utils.id_to_glance_id(context, @@ -1190,8 +1190,8 @@ class CloudController(object): instance_type=instance_types.get_instance_type_by_name( kwargs.get('instance_type', None)), image_href=image_uuid, - min_count=int(kwargs.get('min_count', max_count)), - max_count=max_count, + max_count=int(kwargs.get('max_count', min_count)), + min_count=min_count, kernel_id=kwargs.get('kernel_id'), ramdisk_id=kwargs.get('ramdisk_id'), key_name=kwargs.get('key_name'), -- cgit