From 557d926d4071b82725d09d97bd9ab783484144a8 Mon Sep 17 00:00:00 2001 From: tyagi Date: Mon, 11 May 2015 08:11:08 -0700 Subject: [PATCH] Add attribute type for aws resources Add type field to the schema of the aws resources. Implements: blueprint add-type-in-attributes-schema closes-bug: #1434539 Change-Id: I883313bf0f66c312cc592c62720dd828be488a5c --- .../aws/autoscaling/autoscaling_group.py | 3 ++- .../resources/aws/autoscaling/scaling_policy.py | 3 ++- heat/engine/resources/aws/cfn/wait_condition.py | 5 +++-- heat/engine/resources/aws/ec2/eip.py | 3 ++- heat/engine/resources/aws/ec2/instance.py | 15 ++++++++++----- .../engine/resources/aws/ec2/network_interface.py | 3 ++- heat/engine/resources/aws/ec2/subnet.py | 3 ++- heat/engine/resources/aws/iam/user.py | 6 ++++-- heat/engine/resources/aws/lb/loadbalancer.py | 15 ++++++++++----- heat/engine/resources/aws/s3/s3.py | 6 ++++-- 10 files changed, 41 insertions(+), 21 deletions(-) diff --git a/heat/engine/resources/aws/autoscaling/autoscaling_group.py b/heat/engine/resources/aws/autoscaling/autoscaling_group.py index f5a22ae2ab..dea2ecd384 100644 --- a/heat/engine/resources/aws/autoscaling/autoscaling_group.py +++ b/heat/engine/resources/aws/autoscaling/autoscaling_group.py @@ -214,7 +214,8 @@ class AutoScalingGroup(instgrp.InstanceGroup, cooldown.CooldownMixin): attributes_schema = { INSTANCE_LIST: attributes.Schema( _("A comma-delimited list of server ip addresses. " - "(Heat extension).") + "(Heat extension)."), + type=attributes.Schema.STRING ), } diff --git a/heat/engine/resources/aws/autoscaling/scaling_policy.py b/heat/engine/resources/aws/autoscaling/scaling_policy.py index b97de7935f..d5a6340857 100644 --- a/heat/engine/resources/aws/autoscaling/scaling_policy.py +++ b/heat/engine/resources/aws/autoscaling/scaling_policy.py @@ -87,7 +87,8 @@ class AWSScalingPolicy(heat_sp.AutoScalingPolicy): attributes_schema = { ALARM_URL: attributes.Schema( - _("A signed url to handle the alarm. (Heat extension).") + _("A signed url to handle the alarm. (Heat extension)."), + type=attributes.Schema.STRING ), } diff --git a/heat/engine/resources/aws/cfn/wait_condition.py b/heat/engine/resources/aws/cfn/wait_condition.py index 11493b0a7f..14b6ea20fb 100644 --- a/heat/engine/resources/aws/cfn/wait_condition.py +++ b/heat/engine/resources/aws/cfn/wait_condition.py @@ -67,9 +67,10 @@ class WaitCondition(heat_wc.HeatWaitCondition): attributes_schema = { DATA: attributes.Schema( - _('JSON serialized dict containing data associated with wait ' + _('JSON string containing data associated with wait ' 'condition signals sent to the handle.'), - cache_mode=attributes.Schema.CACHE_NONE + cache_mode=attributes.Schema.CACHE_NONE, + type=attributes.Schema.STRING ), } diff --git a/heat/engine/resources/aws/ec2/eip.py b/heat/engine/resources/aws/ec2/eip.py index 8fa37fdd55..483b12e7ba 100644 --- a/heat/engine/resources/aws/ec2/eip.py +++ b/heat/engine/resources/aws/ec2/eip.py @@ -66,7 +66,8 @@ class ElasticIp(resource.Resource): ALLOCATION_ID: attributes.Schema( _('ID that AWS assigns to represent the allocation of the address ' 'for use with Amazon VPC. Returned only for VPC elastic IP ' - 'addresses.') + 'addresses.'), + type=attributes.Schema.STRING ), } diff --git a/heat/engine/resources/aws/ec2/instance.py b/heat/engine/resources/aws/ec2/instance.py index 17eb69a04a..36b7118171 100644 --- a/heat/engine/resources/aws/ec2/instance.py +++ b/heat/engine/resources/aws/ec2/instance.py @@ -322,19 +322,24 @@ class Instance(resource.Resource): attributes_schema = { AVAILABILITY_ZONE_ATTR: attributes.Schema( _('The Availability Zone where the specified instance is ' - 'launched.') + 'launched.'), + type=attributes.Schema.STRING ), PRIVATE_DNS_NAME: attributes.Schema( - _('Private DNS name of the specified instance.') + _('Private DNS name of the specified instance.'), + type=attributes.Schema.STRING ), PUBLIC_DNS_NAME: attributes.Schema( - _('Public DNS name of the specified instance.') + _('Public DNS name of the specified instance.'), + type=attributes.Schema.STRING ), PRIVATE_IP: attributes.Schema( - _('Private IP address of the specified instance.') + _('Private IP address of the specified instance.'), + type=attributes.Schema.STRING ), PUBLIC_IP: attributes.Schema( - _('Public IP address of the specified instance.') + _('Public IP address of the specified instance.'), + type=attributes.Schema.STRING ), } diff --git a/heat/engine/resources/aws/ec2/network_interface.py b/heat/engine/resources/aws/ec2/network_interface.py index 7cb95a5b03..883468aba1 100644 --- a/heat/engine/resources/aws/ec2/network_interface.py +++ b/heat/engine/resources/aws/ec2/network_interface.py @@ -88,7 +88,8 @@ class NetworkInterface(resource.Resource): attributes_schema = { PRIVATE_IP_ADDRESS: attributes.Schema( - _('Private IP address of the network interface.') + _('Private IP address of the network interface.'), + type=attributes.Schema.STRING ), } diff --git a/heat/engine/resources/aws/ec2/subnet.py b/heat/engine/resources/aws/ec2/subnet.py index f80d9290c5..1469fcade7 100644 --- a/heat/engine/resources/aws/ec2/subnet.py +++ b/heat/engine/resources/aws/ec2/subnet.py @@ -74,7 +74,8 @@ class Subnet(resource.Resource): attributes_schema = { AVAILABILITY_ZONE: attributes.Schema( - _('Availability Zone of the subnet.') + _('Availability Zone of the subnet.'), + type=attributes.Schema.STRING ), } diff --git a/heat/engine/resources/aws/iam/user.py b/heat/engine/resources/aws/iam/user.py index 53fd453ba7..195d064633 100644 --- a/heat/engine/resources/aws/iam/user.py +++ b/heat/engine/resources/aws/iam/user.py @@ -167,11 +167,13 @@ class AccessKey(resource.Resource): attributes_schema = { USER_NAME: attributes.Schema( _('Username associated with the AccessKey.'), - cache_mode=attributes.Schema.CACHE_NONE + cache_mode=attributes.Schema.CACHE_NONE, + type=attributes.Schema.STRING ), SECRET_ACCESS_KEY: attributes.Schema( _('Keypair secret key.'), - cache_mode=attributes.Schema.CACHE_NONE + cache_mode=attributes.Schema.CACHE_NONE, + type=attributes.Schema.STRING ), } diff --git a/heat/engine/resources/aws/lb/loadbalancer.py b/heat/engine/resources/aws/lb/loadbalancer.py index a8460ceca3..69fcf4f10a 100644 --- a/heat/engine/resources/aws/lb/loadbalancer.py +++ b/heat/engine/resources/aws/lb/loadbalancer.py @@ -420,21 +420,26 @@ class LoadBalancer(stack_resource.StackResource): attributes_schema = { CANONICAL_HOSTED_ZONE_NAME: attributes.Schema( _("The name of the hosted zone that is associated with the " - "LoadBalancer.") + "LoadBalancer."), + type=attributes.Schema.STRING ), CANONICAL_HOSTED_ZONE_NAME_ID: attributes.Schema( _("The ID of the hosted zone name that is associated with the " - "LoadBalancer.") + "LoadBalancer."), + type=attributes.Schema.STRING ), DNS_NAME: attributes.Schema( - _("The DNS name for the LoadBalancer.") + _("The DNS name for the LoadBalancer."), + type=attributes.Schema.STRING ), SOURCE_SECURITY_GROUP_GROUP_NAME: attributes.Schema( _("The security group that you can use as part of your inbound " - "rules for your LoadBalancer's back-end instances.") + "rules for your LoadBalancer's back-end instances."), + type=attributes.Schema.STRING ), SOURCE_SECURITY_GROUP_OWNER_ALIAS: attributes.Schema( - _("Owner of the source security group.") + _("Owner of the source security group."), + type=attributes.Schema.STRING ), } diff --git a/heat/engine/resources/aws/s3/s3.py b/heat/engine/resources/aws/s3/s3.py index 53026e42b5..e4b34c5db2 100644 --- a/heat/engine/resources/aws/s3/s3.py +++ b/heat/engine/resources/aws/s3/s3.py @@ -99,10 +99,12 @@ class S3Bucket(resource.Resource): attributes_schema = { DOMAIN_NAME: attributes.Schema( - _('The DNS name of the specified bucket.') + _('The DNS name of the specified bucket.'), + type=attributes.Schema.STRING ), WEBSITE_URL: attributes.Schema( - _('The website endpoint for the specified bucket.') + _('The website endpoint for the specified bucket.'), + type=attributes.Schema.STRING ), }