diff options
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 8800e1a4e4..82ab750ad3 100644 --- a/nova/block_device.py +++ b/nova/block_device.py @@ -182,6 +182,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( @@ -194,6 +195,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) |