summaryrefslogtreecommitdiff
path: root/nova/block_device.py
diff options
context:
space:
mode:
authorNikola Dipanov <ndipanov@redhat.com>2014-06-09 11:48:57 +0200
committerNikola Dipanov <ndipanov@redhat.com>2014-07-17 11:09:38 +0200
commit74c46be2f44c3d84f229a849a89c725a08a4a7fd (patch)
tree08236ec880a11a60c1bbdcca24e6d26e7793f9c8 /nova/block_device.py
parent48b807bf40a17dba2cf171f30283bb9b7153b648 (diff)
downloadnova-74c46be2f44c3d84f229a849a89c725a08a4a7fd.tar.gz
Make BDM dict __init__ behave more like a dict
Currently we can't pass values as kwargs to BlockDeviceDict classes. This is a common way to call a dict constructor so it breaks the dict abstraction a bit. This patch fixes it in a backward compatible way. Change-Id: I31117eecba4f060cb9c7fc3d329f70fd369b168d
Diffstat (limited to 'nova/block_device.py')
-rw-r--r--nova/block_device.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/nova/block_device.py b/nova/block_device.py
index ac5378250a..34453ec6de 100644
--- a/nova/block_device.py
+++ b/nova/block_device.py
@@ -75,10 +75,11 @@ class BlockDeviceDict(dict):
_required_fields = set(['source_type'])
- def __init__(self, bdm_dict=None, do_not_default=None):
+ def __init__(self, bdm_dict=None, do_not_default=None, **kwargs):
super(BlockDeviceDict, self).__init__()
bdm_dict = bdm_dict or {}
+ bdm_dict.update(kwargs)
do_not_default = do_not_default or set()
self._validate(bdm_dict)