Merge "Changes to checkeddict for tuples and required"

This commit is contained in:
Jenkins 2012-05-25 00:29:15 +00:00 committed by Gerrit Code Review
commit a16a8bb9c2
3 changed files with 9 additions and 6 deletions

View File

@ -135,9 +135,11 @@ class Properties(CheckedDict):
def validate(self):
for key in self.data:
# are there missing required Properties
if 'Required' in self.data[key] and not 'Value' in self.data[key]:
return {'Error': \
'%s Property must be provided' % key}
if 'Required' in self.data[key]:
if self.data[key]['Required'] \
and not 'Value' in self.data[key]:
return {'Error': \
'%s Property must be provided' % key}
# are there unimplemented Properties
if not self.data[key]['Implemented'] and 'Value' in self.data[key]:

View File

@ -29,9 +29,9 @@ class SecurityGroup(Resource):
'Required': True},
'VpcId': {'Type': 'String',
'Implemented': False},
'SecurityGroupIngress': {'Type': 'CommaDelimitedList',
'SecurityGroupIngress': {'Type': 'TuplesList',
'Implemented': False},
'SecurityGroupEgress': {'Type': 'CommaDelimitedList'}}
'SecurityGroupEgress': {'Type': 'TuplesList'}}
def __init__(self, name, json_snippet, stack):
super(SecurityGroup, self).__init__(name, json_snippet, stack)

View File

@ -28,7 +28,8 @@ class Volume(Resource):
properties_schema = {'AvailabilityZone': {'Type': 'String',
'Required': True},
'Size': {'Type': 'Number'},
'SnapshotId': {'Type': 'String'}}
'SnapshotId': {'Type': 'String'},
'Tags': {'Type': 'TuplesList'}}
def __init__(self, name, json_snippet, stack):
super(Volume, self).__init__(name, json_snippet, stack)