diff options
author | Nikola Dipanov <ndipanov@redhat.com> | 2013-05-12 16:01:12 +0200 |
---|---|---|
committer | Nikola Dipanov <ndipanov@redhat.com> | 2013-06-08 10:35:32 +0200 |
commit | d581ed04a584fdd83df78e43366a3617b154a626 (patch) | |
tree | 6ee8c3fc71506b570617726e01961284112a373e /nova/exception.py | |
parent | e0142d0f63bf64a07db3bd3b840fc2072d2e6ca3 (diff) | |
download | nova-d581ed04a584fdd83df78e43366a3617b154a626.tar.gz nova-d581ed04a584fdd83df78e43366a3617b154a626.tar.xz nova-d581ed04a584fdd83df78e43366a3617b154a626.zip |
BDM class and transformation functions
This patch adds the utility functions that will help us switch
between versions of block device mapping data.
In order to accomplish this, and to have a more structured approach to
dealing with block device mapping data in the future, this patch
introduces a BlockDeviceDict class which is a thin wrapper around a
standard dict that makes it easier to reason about which fields are
present in the dictionary, and introduces said conversion routines.
blueprint: improve-block-device-handling
Change-Id: I9370333059b8c9aaf92010470b8475a913d329b2
Diffstat (limited to 'nova/exception.py')
-rw-r--r-- | nova/exception.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/nova/exception.py b/nova/exception.py index bbe5442f1..75791b01a 100644 --- a/nova/exception.py +++ b/nova/exception.py @@ -221,6 +221,17 @@ class InvalidBDMVolume(InvalidBDM): "failed to get volume %(id)s.") +class InvalidBDMFormat(InvalidBDM): + message = _("Block Device Mapping is Invalid: " + "some fields are not recognized, " + "or have invalid values.") + + +class InvalidBDMForLegacy(InvalidBDM): + message = _("Block Device Mapping cannot " + "be converted to legacy format. ") + + class VolumeUnattached(Invalid): message = _("Volume %(volume_id)s is not attached to anything") |