From 718d01dea2399de8f211fdc024c990cdd593cc75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20P=C3=B6hn?= Date: Sat, 25 Mar 2017 03:50:22 +0100 Subject: [PATCH] makebuildserver added sleep after destroy/undefine --- makebuildserver | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/makebuildserver b/makebuildserver index 19ea04bd..c3a6ab81 100755 --- a/makebuildserver +++ b/makebuildserver @@ -14,6 +14,7 @@ import hashlib import yaml import math import json +import time import logging from clint.textui import progress from optparse import OptionParser @@ -348,6 +349,8 @@ def destroy_current_image(v, serverdir): try: logger.debug('virsh -c qemu:///system destroy %s', config['domain']) subprocess.check_call(['virsh', '-c', 'qemu:///system', 'destroy', config['domain']]) + logging.info("...waiting a sec...") + time.sleep(10) except subprocess.CalledProcessError as e: logging.info("could not force libvirt domain '%s' off: %s", config['domain'], e) try: @@ -355,6 +358,8 @@ def destroy_current_image(v, serverdir): # for undefining domains correctly. logger.debug('virsh -c qemu:///system undefine %s --nvram --managed-save --remove-all-storage --snapshots-metadata', config['domain']) subprocess.check_call(('virsh', '-c', 'qemu:///system', 'undefine', config['domain'], '--nvram', '--managed-save', '--remove-all-storage', '--snapshots-metadata')) + logging.info("...waiting a sec...") + time.sleep(10) except subprocess.CalledProcessError as e: logger.info("could not undefine libvirt domain '%s': %s", dom.name(), e) except libvirt.libvirtError as e: