]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Lookup the class for an Instance in Autoscaling
authorZane Bitter <zbitter@redhat.com>
Tue, 27 Nov 2012 14:13:55 +0000 (15:13 +0100)
committerZane Bitter <zbitter@redhat.com>
Wed, 28 Nov 2012 21:40:36 +0000 (22:40 +0100)
Instead of hardcoding the class for handling instances in autoscaling,
look up the class for the AWS::EC2::Instance resource type using the same
mechanism used for creating resources normally.

Change-Id: I37b9aff9a83b89cdc782467720970a04549d7b1e
Signed-off-by: Zane Bitter <zbitter@redhat.com>
heat/engine/resources/autoscaling.py

index 36148bdcefb0c25b667dc94540ebed5417d095fc..3ca2844f6ea842b52a390c5ec8640968cc449fe7 100644 (file)
@@ -65,9 +65,10 @@ class AutoScalingGroup(resource.Resource):
         return self.UPDATE_REPLACE
 
     def _make_instance(self, name):
+        Instance = resource.get_class('AWS::EC2::Instance')
         conf = self.properties['LaunchConfigurationName']
         instance_definition = self.stack.t['Resources'][conf]
-        return instance.Instance(name, instance_definition, self.stack)
+        return Instance(name, instance_definition, self.stack)
 
     def handle_delete(self):
         if self.resource_id is not None: