diff options
author | Vishvananda Ishaya <vishvananda@gmail.com> | 2013-01-24 10:07:33 +0000 |
---|---|---|
committer | Pádraig Brady <pbrady@redhat.com> | 2013-01-29 14:53:12 +0000 |
commit | 24fffd9d8b77e9b71e8013fc22c172f76bb4e84c (patch) | |
tree | b6c8968294beaac0ab470f6d9e99923e5231d911 /nova/exception.py | |
parent | 3ddd1aeda69b1d8d0bc689fea8d4c2c530d55fc0 (diff) | |
download | nova-24fffd9d8b77e9b71e8013fc22c172f76bb4e84c.tar.gz nova-24fffd9d8b77e9b71e8013fc22c172f76bb4e84c.tar.xz nova-24fffd9d8b77e9b71e8013fc22c172f76bb4e84c.zip |
validate specified volumes to boot from at the API layer
This causes the create to fail fast instead of putting
the instance into error later in the process.
Related to bug: 1069904
Change-Id: I5f7c8d20d3ebf33ce1ce64bf0a8418bd2b5a6411
Diffstat (limited to 'nova/exception.py')
-rw-r--r-- | nova/exception.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/nova/exception.py b/nova/exception.py index bb7749dd7..6915c14bb 100644 --- a/nova/exception.py +++ b/nova/exception.py @@ -226,6 +226,20 @@ class Invalid(NovaException): code = 400 +class InvalidBDM(Invalid): + message = _("Block Device Mapping is Invalid.") + + +class InvalidBDMSnapshot(InvalidBDM): + message = _("Block Device Mapping is Invalid: " + "failed to get snapshot %(id)s.") + + +class InvalidBDMVolume(InvalidBDM): + message = _("Block Device Mapping is Invalid: " + "failed to get volume %(id)s.") + + class VolumeUnattached(Invalid): message = _("Volume %(volume_id)s is not attached to anything") |