From e8c0a7ed6b44b59e503fb209e1ff7432102da9e9 Mon Sep 17 00:00:00 2001 From: Zane Bitter Date: Fri, 29 Nov 2013 21:50:30 +0100 Subject: [PATCH] Fix bad resource schema for Volume Change-Id: Id8faa530fc7cdd1f3fc287c033ed61aa87fd9807 --- heat/engine/resources/volume.py | 4 ++-- heat/tests/test_volume.py | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/heat/engine/resources/volume.py b/heat/engine/resources/volume.py index f0759b80ef..1371df0efd 100644 --- a/heat/engine/resources/volume.py +++ b/heat/engine/resources/volume.py @@ -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' diff --git a/heat/tests/test_volume.py b/heat/tests/test_volume.py index c95d1b21f7..ed3facb2e6 100644 --- a/heat/tests/test_volume.py +++ b/heat/tests/test_volume.py @@ -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')