From b9b262422f17d540fed44fd5600773189101e4fb Mon Sep 17 00:00:00 2001 From: Marcus Hoffmann Date: Sat, 25 Nov 2017 00:38:00 +0100 Subject: [PATCH] vmtools: remove old vagrant workaround This was introduced in cd23bb933c7c5d67cff35ada0f5edeac917c791f apparently to work around problems in vagrant 1.3.5. This seems not to be necessary any more, I have never had a problem with those sleeps removed. --- fdroidserver/vmtools.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/fdroidserver/vmtools.py b/fdroidserver/vmtools.py index 97e1c52c..0e573949 100644 --- a/fdroidserver/vmtools.py +++ b/fdroidserver/vmtools.py @@ -22,7 +22,6 @@ import os import math import json import tarfile -import time import shutil import subprocess import textwrap @@ -192,8 +191,6 @@ class FDroidBuildVm(): def up(self, provision=True): try: self.vgrnt.up(provision=provision) - logger.info('...waiting a sec...') - time.sleep(10) self.srvuuid = self._vagrant_fetch_uuid() except subprocess.CalledProcessError as e: raise FDroidBuildVmException("could not bring up vm '%s'" % self.srvname) from e @@ -202,8 +199,6 @@ class FDroidBuildVm(): logger.info('suspending buildserver') try: self.vgrnt.suspend() - logger.info('...waiting a sec...') - time.sleep(10) except subprocess.CalledProcessError as e: raise FDroidBuildVmException("could not suspend vm '%s'" % self.srvname) from e @@ -350,16 +345,12 @@ class LibvirtBuildVm(FDroidBuildVm): # (eg. lookupByName only works on running VMs) try: _check_call(('virsh', '-c', 'qemu:///system', 'destroy', self.srvname)) - logger.info("...waiting a sec...") - time.sleep(10) except subprocess.CalledProcessError as e: logger.info("could not force libvirt domain '%s' off: %s", self.srvname, e) try: # libvirt python bindings do not support all flags required # for undefining domains correctly. _check_call(('virsh', '-c', 'qemu:///system', 'undefine', self.srvname, '--nvram', '--managed-save', '--remove-all-storage', '--snapshots-metadata')) - logger.info("...waiting a sec...") - time.sleep(10) except subprocess.CalledProcessError as e: logger.info("could not undefine libvirt domain '%s': %s", self.srvname, e) @@ -454,8 +445,6 @@ class LibvirtBuildVm(FDroidBuildVm): logger.info("creating snapshot '%s' for vm '%s'", snapshot_name, self.srvname) try: _check_call(['virsh', '-c', 'qemu:///system', 'snapshot-create-as', self.srvname, snapshot_name]) - logger.info('...waiting a sec...') - time.sleep(10) except subprocess.CalledProcessError as e: raise FDroidBuildVmException("could not cerate snapshot '%s' " "of libvirt vm '%s'" @@ -484,8 +473,6 @@ class LibvirtBuildVm(FDroidBuildVm): dom = self.conn.lookupByName(self.srvname) snap = dom.snapshotLookupByName(snapshot_name) dom.revertToSnapshot(snap) - logger.info('...waiting a sec...') - time.sleep(10) except libvirt.libvirtError as e: raise FDroidBuildVmException('could not revert domain \'%s\' to snapshot \'%s\'' % (self.srvname, snapshot_name)) from e @@ -501,8 +488,6 @@ class VirtualboxBuildVm(FDroidBuildVm): logger.info("creating snapshot '%s' for vm '%s'", snapshot_name, self.srvname) try: _check_call(['VBoxManage', 'snapshot', self.srvuuid, 'take', 'fdroidclean'], cwd=self.srvdir) - logger.info('...waiting a sec...') - time.sleep(10) except subprocess.CalledProcessError as e: raise FDroidBuildVmException('could not cerate snapshot ' 'of virtualbox vm %s'