mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-20 13:50:12 +01:00
vmtools: remove old vagrant workaround
This was introduced in cd23bb933c
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.
This commit is contained in:
parent
4b51cc273a
commit
b9b262422f
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user