On 03/03/2017 05:33 PM, Ramon Medeiros wrote:
Allow vmstorage creation passing disk bus
Signed-off-by: Ramon Medeiros <ramonn(a)linux.vnet.ibm.com>
---
model/vmstorages.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/model/vmstorages.py b/model/vmstorages.py
index 143225c..b123b50 100644
--- a/model/vmstorages.py
+++ b/model/vmstorages.py
@@ -91,7 +91,9 @@ class VMStoragesModel(object):
raise InvalidParameter("KCHVMSTOR0019E")
dom = VMModel.get_vm(vm_name, self.conn)
- params['bus'] = _get_device_bus(params['type'], dom)
+
+ if params.get('bus') == None:
+ params['bus'] = _get_device_bus(params['type'], dom)
Just a tip. Some recent pep8 version requires to be "is None" instead of ==
if is_s390x() and params['type'] == 'disk' and
'dir_path' in params:
if 'format' not in params: