diff options
author | Jenkins <jenkins@review.openstack.org> | 2015-02-02 17:47:43 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2015-02-02 17:47:43 +0000 |
commit | 9debd59494154cef416f5dcf77ba48eac5a7291f (patch) | |
tree | 426c9b5849aac33eb5eefc96e69fb40445e7283c /nova/block_device.py | |
parent | d47f80d5607ee9921918420b29f8718f1ac1e5f7 (diff) | |
parent | 67bcff461497e674ccdf5d335d983fe9a16639fa (diff) | |
download | nova-9debd59494154cef416f5dcf77ba48eac5a7291f.tar.gz |
Merge "Reject unsupported image to local BDM"
Diffstat (limited to 'nova/block_device.py')
-rw-r--r-- | nova/block_device.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/nova/block_device.py b/nova/block_device.py index 31a9cbc593..4ab0586efa 100644 --- a/nova/block_device.py +++ b/nova/block_device.py @@ -180,6 +180,7 @@ class BlockDeviceDict(dict): source_type = api_dict.get('source_type') device_uuid = api_dict.get('uuid') + destination_type = api_dict.get('destination_type') if source_type not in ('volume', 'image', 'snapshot', 'blank'): raise exception.InvalidBDMFormat( @@ -192,6 +193,9 @@ class BlockDeviceDict(dict): raise exception.InvalidBDMFormat( details=_("Missing device UUID.")) api_dict[source_type + '_id'] = device_uuid + if source_type == 'image' and destination_type == 'local': + raise exception.InvalidBDMFormat( + details=_("Mapping image to local is not supported.")) api_dict.pop('uuid', None) return cls(api_dict) |