From 3379e821f715d6c63af3f0e96d276ca3f3ff24ca Mon Sep 17 00:00:00 2001 From: Ronen Kat Date: Mon, 6 Aug 2012 10:11:10 +0300 Subject: 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 --- nova/exception.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'nova/exception.py') diff --git a/nova/exception.py b/nova/exception.py index cd1eabc9d..784f90a6e 100644 --- a/nova/exception.py +++ b/nova/exception.py @@ -230,6 +230,10 @@ class VolumeUnattached(Invalid): message = _("Volume %(volume_id)s is not attached to anything") +class VolumeAttached(Invalid): + message = _("Volume %(volume_id)s is still attached, detach volume first.") + + class InvalidKeypair(Invalid): message = _("Keypair data is invalid") @@ -1018,7 +1022,7 @@ class VolumeTypeCreateFailed(NovaException): class VolumeBackendAPIException(NovaException): message = _("Bad or unexpected response from the storage volume " - "backend API: data=%(data)s") + "backend API: %(data)s") class InstanceTypeCreateFailed(NovaException): -- cgit