Merge "Reboot libvirt VM in case of boot failure"

This commit is contained in:
Jenkins 2014-08-18 10:52:37 +00:00 committed by Gerrit Code Review
commit b4659cff27
2 changed files with 6 additions and 0 deletions

View File

@ -43,6 +43,9 @@ class DevopsDriver(object):
if settings.VNC_PASSWORD:
self.vnc_password = settings.VNC_PASSWORD
if settings.REBOOT_TIMEOUT:
self.reboot_timeout = settings.REBOOT_TIMEOUT
def __del__(self):
self.conn.close()

View File

@ -163,6 +163,9 @@ class LibvirtXMLBuilder(object):
node_xml.type(node.os_type, arch=node.architecture)
for boot_dev in json.loads(node.boot):
node_xml.boot(dev=boot_dev)
if self.driver.reboot_timeout:
node_xml.bios(rebootTimeout='{0}'.format(
self.driver.reboot_timeout))
with node_xml.devices:
node_xml.emulator(emulator)