From 22b484a6d0b65c2a41fd4c730a5ebddf98c70c84 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Wed, 14 Mar 2012 09:26:40 -0700 Subject: Allow errored volumes to be deleted * Allow volumes with no host set to be deleted from db * Allow volumes in state error to be deleted * Replicates code from nova-manage command * Fixes bug 953594 Change-Id: Ia8b4594a626df58f030406b12dd003f5c9215612 --- nova/tests/test_vsa_volumes.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'nova/tests') diff --git a/nova/tests/test_vsa_volumes.py b/nova/tests/test_vsa_volumes.py index 7f5a70d3a..adf22077c 100644 --- a/nova/tests/test_vsa_volumes.py +++ b/nova/tests/test_vsa_volumes.py @@ -93,9 +93,8 @@ class VsaVolumesTestCase(test.TestCase): self.assertEqual(volume_ref['status'], 'creating') - self.volume_api.update(self.context, - volume_ref, - {'status': 'available'}) + self.volume_api.update(self.context, volume_ref, + {'status': 'available', 'host': 'fake'}) volume_ref = self.volume_api.get(self.context, volume_ref['id']) self.volume_api.delete(self.context, volume_ref) @@ -110,9 +109,9 @@ class VsaVolumesTestCase(test.TestCase): volume_param = self._default_volume_param() volume_ref = self.volume_api.create(self.context, **volume_param) - self.volume_api.update(self.context, - volume_ref, - {'status': 'in-use'}) + self.volume_api.update(self.context, volume_ref, + {'status': 'in-use', 'host': 'fake'}) + volume_ref = self.volume_api.get(self.context, volume_ref['id']) self.assertRaises(exception.InvalidVolume, self.volume_api.delete, self.context, volume_ref) -- cgit