Lookup the class for an Instance in Autoscaling

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>
This commit is contained in:
Zane Bitter 2012-11-27 15:13:55 +01:00
parent 4b6f1b8ad0
commit b6711c12e3
1 changed files with 2 additions and 1 deletions

View 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: