Fix bad resource schema for Volume

Change-Id: Id8faa530fc7cdd1f3fc287c033ed61aa87fd9807
This commit is contained in:
Zane Bitter 2013-11-29 21:50:30 +01:00
parent d0c7a5e98e
commit e8c0a7ed6b
2 changed files with 14 additions and 2 deletions

View File

@ -50,8 +50,8 @@ class Volume(resource.Resource):
'Tags': {
'Type': 'List',
'Description': _('The list of tags to associate '
'with the volume.')},
'Schema': {'Type': 'Map', 'Schema': tags_schema},
'with the volume.'),
'Schema': {'Type': 'Map', 'Schema': tags_schema}},
}
_restore_property = 'SnapshotId'

View File

@ -232,6 +232,18 @@ class VolumeTest(HeatTestCase):
self.m.VerifyAll()
def test_volume_bad_tags(self):
t = template_format.parse(volume_template)
t['Resources']['DataVolume']['Properties']['Tags'] = [{'Foo': 'bar'}]
stack = utils.parse_stack(t, stack_name='test_volume_bad_tags_stack')
rsrc = vol.Volume('DataVolume',
t['Resources']['DataVolume'],
stack)
self.assertRaises(exception.StackValidationFailed, rsrc.validate)
self.m.VerifyAll()
def test_volume_attachment_error(self):
fv = FakeVolume('creating', 'available')
fva = FakeVolume('attaching', 'error')