diff options
| author | Ronen Kat <ronenkat@il.ibm.com> | 2012-08-06 10:11:10 +0300 |
|---|---|---|
| committer | Mark McLoughlin <markmc@redhat.com> | 2012-09-07 14:07:01 +0100 |
| commit | 3379e821f715d6c63af3f0e96d276ca3f3ff24ca (patch) | |
| tree | 8795e48c3aba4c45040a302a660f506b68b565ce /nova/tests | |
| parent | 37cc45b8fdaa199b248a7ef5f683d514733b8387 (diff) | |
Use volume driver specific exceptions
Change generic use of exception.NovaException in the nova/volume directory
to specific exceptions. The exceptions used in this patch are:
exception.VolumeBackendAPIException
exception.InvalidInput
exception.InvalidVolume
exception.VolumeAtatched
Patch includes updates to the appropriate tests as well.
(cherry picked from cinder commit 3905a99)
Change-Id: I10407ff3f5babe64e88f445d3529269b7665ee16
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/test_storwize_svc.py | 18 | ||||
| -rw-r--r-- | nova/tests/test_volume.py | 2 |
2 files changed, 10 insertions, 10 deletions
diff --git a/nova/tests/test_storwize_svc.py b/nova/tests/test_storwize_svc.py index e735bf66c..ac17f0968 100644 --- a/nova/tests/test_storwize_svc.py +++ b/nova/tests/test_storwize_svc.py @@ -882,7 +882,7 @@ class StorwizeSVCDriverTestCase(test.TestCase): # Check for missing san_ip saved = storwize_svc.FLAGS.san_ip storwize_svc.FLAGS.san_ip = None - self.assertRaises(exception.InvalidParameterValue, + self.assertRaises(exception.InvalidInput, self.driver._check_flags) storwize_svc.FLAGS.san_ip = saved @@ -906,7 +906,7 @@ class StorwizeSVCDriverTestCase(test.TestCase): orig_pool = getattr(storwize_svc.FLAGS, "storwize_svc_volpool_name") no_exist_pool = "i-dont-exist-%s" % random.randint(10000, 99999) storwize_svc.FLAGS.storwize_svc_volpool_name = no_exist_pool - self.assertRaises(exception.InvalidParameterValue, + self.assertRaises(exception.InvalidInput, self.driver.check_for_setup_error) storwize_svc.FLAGS.storwize_svc_volpool_name = orig_pool @@ -934,44 +934,44 @@ class StorwizeSVCDriverTestCase(test.TestCase): saved_key = storwize_svc.FLAGS.san_private_key storwize_svc.FLAGS.san_password = None storwize_svc.FLAGS.san_private_key = None - self.assertRaises(exception.InvalidParameterValue, + self.assertRaises(exception.InvalidInput, self.driver._check_flags) storwize_svc.FLAGS.san_password = saved_pass storwize_svc.FLAGS.san_private_key = saved_key saved = storwize_svc.FLAGS.storwize_svc_vol_vtype storwize_svc.FLAGS.storwize_svc_vol_vtype = "invalid" - self.assertRaises(exception.InvalidParameterValue, + self.assertRaises(exception.InvalidInput, self.driver._check_flags) storwize_svc.FLAGS.storwize_svc_vol_vtype = saved saved = storwize_svc.FLAGS.storwize_svc_vol_rsize storwize_svc.FLAGS.storwize_svc_vol_rsize = "invalid" - self.assertRaises(exception.InvalidParameterValue, + self.assertRaises(exception.InvalidInput, self.driver._check_flags) storwize_svc.FLAGS.storwize_svc_vol_rsize = saved saved = storwize_svc.FLAGS.storwize_svc_vol_warning storwize_svc.FLAGS.storwize_svc_vol_warning = "invalid" - self.assertRaises(exception.InvalidParameterValue, + self.assertRaises(exception.InvalidInput, self.driver._check_flags) storwize_svc.FLAGS.storwize_svc_vol_warning = saved saved = storwize_svc.FLAGS.storwize_svc_vol_autoexpand storwize_svc.FLAGS.storwize_svc_vol_autoexpand = "invalid" - self.assertRaises(exception.InvalidParameterValue, + self.assertRaises(exception.InvalidInput, self.driver._check_flags) storwize_svc.FLAGS.storwize_svc_vol_autoexpand = saved saved = storwize_svc.FLAGS.storwize_svc_vol_grainsize storwize_svc.FLAGS.storwize_svc_vol_grainsize = str(42) - self.assertRaises(exception.InvalidParameterValue, + self.assertRaises(exception.InvalidInput, self.driver._check_flags) storwize_svc.FLAGS.storwize_svc_vol_grainsize = saved saved = storwize_svc.FLAGS.storwize_svc_flashcopy_timeout storwize_svc.FLAGS.storwize_svc_flashcopy_timeout = str(601) - self.assertRaises(exception.InvalidParameterValue, + self.assertRaises(exception.InvalidInput, self.driver._check_flags) storwize_svc.FLAGS.storwize_svc_flashcopy_timeout = saved diff --git a/nova/tests/test_volume.py b/nova/tests/test_volume.py index a147a3a99..0752d2b9b 100644 --- a/nova/tests/test_volume.py +++ b/nova/tests/test_volume.py @@ -248,7 +248,7 @@ class VolumeTestCase(test.TestCase): self.assertEqual(vol['mountpoint'], mountpoint) self.assertEqual(vol['instance_uuid'], instance_uuid) - self.assertRaises(exception.NovaException, + self.assertRaises(exception.VolumeAttached, self.volume.delete_volume, self.context, volume_id) |
