adding additional params

This commit is contained in:
kevgliss 2016-02-03 15:38:58 -08:00
parent ac4ce7d53f
commit 3ce6627826
2 changed files with 12 additions and 4 deletions

View File

@ -37,12 +37,14 @@ class FakeScalingPolicy(object):
class FakeLaunchConfiguration(object): class FakeLaunchConfiguration(object):
def __init__(self, name, image_id, key_name, security_groups, user_data, def __init__(self, name, image_id, key_name, ramdisk_id, kernel_id, security_groups, user_data,
instance_type, instance_monitoring, instance_profile_name, instance_type, instance_monitoring, instance_profile_name,
spot_price, ebs_optimized, associate_public_ip_address, block_device_mapping_dict): spot_price, ebs_optimized, associate_public_ip_address, block_device_mapping_dict):
self.name = name self.name = name
self.image_id = image_id self.image_id = image_id
self.key_name = key_name self.key_name = key_name
self.ramdisk_id = ramdisk_id
self.kernel_id = kernel_id
self.security_groups = security_groups if security_groups else [] self.security_groups = security_groups if security_groups else []
self.user_data = user_data self.user_data = user_data
self.instance_type = instance_type self.instance_type = instance_type
@ -63,6 +65,8 @@ class FakeLaunchConfiguration(object):
config = backend.create_launch_configuration( config = backend.create_launch_configuration(
name=resource_name, name=resource_name,
image_id=properties.get("ImageId"), image_id=properties.get("ImageId"),
kernel_id=properties.get("KernelId"),
ramdisk_id=properties.get("RamdiskId"),
key_name=properties.get("KeyName"), key_name=properties.get("KeyName"),
security_groups=properties.get("SecurityGroups"), security_groups=properties.get("SecurityGroups"),
user_data=properties.get("UserData"), user_data=properties.get("UserData"),
@ -231,7 +235,7 @@ class AutoScalingBackend(BaseBackend):
self.__dict__ = {} self.__dict__ = {}
self.__init__(ec2_backend, elb_backend) self.__init__(ec2_backend, elb_backend)
def create_launch_configuration(self, name, image_id, key_name, def create_launch_configuration(self, name, image_id, key_name, kernel_id, ramdisk_id,
security_groups, user_data, instance_type, security_groups, user_data, instance_type,
instance_monitoring, instance_profile_name, instance_monitoring, instance_profile_name,
spot_price, ebs_optimized, associate_public_ip_address, block_device_mappings): spot_price, ebs_optimized, associate_public_ip_address, block_device_mappings):
@ -239,6 +243,8 @@ class AutoScalingBackend(BaseBackend):
name=name, name=name,
image_id=image_id, image_id=image_id,
key_name=key_name, key_name=key_name,
kernel_id=kernel_id,
ramdisk_id=ramdisk_id,
security_groups=security_groups, security_groups=security_groups,
user_data=user_data, user_data=user_data,
instance_type=instance_type, instance_type=instance_type,

View File

@ -20,6 +20,8 @@ class AutoScalingResponse(BaseResponse):
name=self._get_param('LaunchConfigurationName'), name=self._get_param('LaunchConfigurationName'),
image_id=self._get_param('ImageId'), image_id=self._get_param('ImageId'),
key_name=self._get_param('KeyName'), key_name=self._get_param('KeyName'),
ramdisk_id=self._get_param('RamdiskId'),
kernel_id=self._get_param('KernelId'),
security_groups=self._get_multi_param('SecurityGroups.member'), security_groups=self._get_multi_param('SecurityGroups.member'),
user_data=self._get_param('UserData'), user_data=self._get_param('UserData'),
instance_type=self._get_param('InstanceType'), instance_type=self._get_param('InstanceType'),
@ -155,7 +157,7 @@ DESCRIBE_LAUNCH_CONFIGURATIONS_TEMPLATE = """<DescribeLaunchConfigurationsRespon
{% endfor %} {% endfor %}
</SecurityGroups> </SecurityGroups>
<CreatedTime>2013-01-21T23:04:42.200Z</CreatedTime> <CreatedTime>2013-01-21T23:04:42.200Z</CreatedTime>
<KernelId/> <KernelId>{{ launch_configuration.kernel_id }}</KernelId>
{% if launch_configuration.instance_profile_name %} {% if launch_configuration.instance_profile_name %}
<IamInstanceProfile>{{ launch_configuration.instance_profile_name }}</IamInstanceProfile> <IamInstanceProfile>{{ launch_configuration.instance_profile_name }}</IamInstanceProfile>
{% endif %} {% endif %}
@ -202,7 +204,7 @@ DESCRIBE_LAUNCH_CONFIGURATIONS_TEMPLATE = """<DescribeLaunchConfigurationsRespon
{% else %} {% else %}
<KeyName/> <KeyName/>
{% endif %} {% endif %}
<RamdiskId/> <RamdiskId>{{ launch_configuration.ramdisk_id }}</RamdiskId>
<EbsOptimized>{{ launch_configuration.ebs_optimized }}</EbsOptimized> <EbsOptimized>{{ launch_configuration.ebs_optimized }}</EbsOptimized>
<InstanceMonitoring> <InstanceMonitoring>
<Enabled>{{ launch_configuration.instance_monitoring_enabled }}</Enabled> <Enabled>{{ launch_configuration.instance_monitoring_enabled }}</Enabled>