Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:GA
cobbler.378
fix-restart-paravirt-xen.dif
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File fix-restart-paravirt-xen.dif of Package cobbler.378
Index: cobbler-2.6.6/koan/app.py =================================================================== --- cobbler-2.6.6.orig/koan/app.py +++ cobbler-2.6.6/koan/app.py @@ -62,6 +62,10 @@ import socket import utils import time import configurator +try: + import xml.etree.ElementTree as etree +except ImportError: + etree = None COBBLER_REQUIRED = 1.300 @@ -1526,7 +1530,9 @@ class Koan: return "failed" elif state == "shutdown": print "- shutdown VM detected, is the install done? Restarting!" - utils.find_vm(conn, virtname).create() + dom = utils.find_vm(conn, virtname) + self.fix_restart_config(conn, dom) + dom.create() return results else: raise InfoException("internal error, bad virt state") @@ -1546,6 +1552,48 @@ class Koan: #--------------------------------------------------- + def fix_restart_config(self, conn, dom): + if self.virt_type not in [ "xenpv", "xenfv" ]: + return + if not etree: + return + # we need to fix XEN only + xml = dom.XMLDesc(0) + root = etree.fromstring(xml) + on = root.findall('on_poweroff') + if on and len(on) == 1: + #print "set on_oweroff to destroy" + on[0].text = "destroy" + on = root.findall('on_reboot') + if on and len(on) == 1: + #print "set on_reboot to restart" + on[0].text = "restart" + on = root.findall('on_crash') + if on and len(on) == 1: + #print "set on_crash to restart" + on[0].text = "restart" + + if self.virt_type == "xenpv": + bootloader = root.findall('bootloader') + if bootloader and len(bootloader) == 1: + #print "set bootloader to pygrub" + bootloader[0].text = '/usr/bin/pygrub' + ose = root.findall('os') + if ose and len(ose) == 1: + #print "remove os" + root.remove(ose[0]) + elif self.virt_type == "xenfv": + oses = root.findall("./os") + for os in oses: + for item in os: + if item.tag == 'boot' and item.get('dev', '') == 'network': + #print "remove network boot" + os.remove(item) + + conn.defineXML(etree.tostring(root)) + + #--------------------------------------------------- + def load_virt_modules(self): try: import xencreate
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor