Remove capacity check from AWS::AG update
When heat is trying to update autoscaling group resource with
the same template an exception is raised because nested stack
is not in (UPDATE, COMPLETE) state. It happens because heat
doesn't change the state of nested stacks if size of Autoscaling
group has not been changed. So fix allows handle_update in
AWS::AutoscalingGroup to launch resize despite of changes
in AG capacity.
Change-Id: Ibb71f31f2ec7d1d37b995323a2474b799ea498bb
Closes-bug: #1429134
diff --git a/functional/test_heat_autoscaling.py b/functional/test_heat_autoscaling.py
index 340038c..0e6e0cb 100644
--- a/functional/test_heat_autoscaling.py
+++ b/functional/test_heat_autoscaling.py
@@ -97,3 +97,39 @@
expected_resources = {'random_group': 'OS::Heat::AutoScalingGroup'}
self.assertEqual(expected_resources, self.list_resources(stack_id))
self._assert_output_values(stack_id)
+
+
+class AutoScalingGroupUpdateWithNoChanges(test.HeatIntegrationTest):
+
+ template = '''
+heat_template_version: 2013-05-23
+
+resources:
+ test_group:
+ type: OS::Heat::AutoScalingGroup
+ properties:
+ desired_capacity: 0
+ max_size: 0
+ min_size: 0
+ resource:
+ type: OS::Heat::RandomString
+ test_policy:
+ type: OS::Heat::ScalingPolicy
+ properties:
+ adjustment_type: change_in_capacity
+ auto_scaling_group_id: { get_resource: test_group }
+ scaling_adjustment: 1
+'''
+
+ def setUp(self):
+ super(AutoScalingGroupUpdateWithNoChanges, self).setUp()
+ self.client = self.orchestration_client
+
+ def test_as_group_update_without_resource_changes(self):
+ stack_identifier = self.stack_create(template=self.template)
+ new_template = self.template.replace(
+ 'scaling_adjustment: 1',
+ 'scaling_adjustment: 2')
+
+ self.update_stack(stack_identifier, template=new_template)
+ self._wait_for_stack_status(stack_identifier, 'UPDATE_COMPLETE')