From: Harshal Patil <harshalp(a)linux.vnet.ibm.com>
This patch fixes the incorrect condition for updating
boot order, also makes sure on s390x arch the cdrom
is always the first boot device
Signed-off-by: Harshal Patil <harshalp(a)linux.vnet.ibm.com>
---
model/vms.py | 2 +-
vmtemplate.py | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/model/vms.py b/model/vms.py
index 1ef5434..737f27e 100644
--- a/model/vms.py
+++ b/model/vms.py
@@ -876,7 +876,7 @@ class VMModel(object):
new_xml = self._update_memory_config(new_xml, params, dom)
# update bootorder or bootmenu
- if "bootorder" or "bootmenu" in params:
+ if ("bootorder" or "bootmenu") in params:
new_xml = self._update_bootorder(new_xml, params)
if platform.machine() in ['s390', 's390x'] and
params.get('console'):
diff --git a/vmtemplate.py b/vmtemplate.py
index 91181ab..e0661ab 100644
--- a/vmtemplate.py
+++ b/vmtemplate.py
@@ -434,7 +434,10 @@ class VMTemplate(object):
# Set the boot order of VM
# TODO: need modify this when boot order edition feature came upstream.
- params['boot_order'] = get_bootorder_xml()
+ if cdrom_xml and params.get('arch') == 's390x':
+ params['boot_order'] = get_bootorder_xml(['cdrom',
'hd', 'network'])
+ else:
+ params['boot_order'] = get_bootorder_xml()
# Setting maximum number of memory slots
slots = str(self.info['mem_dev_slots'])
--
2.7.4