1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-19 21:30:10 +01:00

Merge branch 'vmtools_561' into 'master'

actually use the chosen vagrant provider

Closes #561

See merge request fdroid/fdroidserver!573
This commit is contained in:
Michael Pöhn 2018-09-13 08:50:21 +00:00
commit ba92623c1e

View File

@ -103,7 +103,7 @@ def get_build_vm(srvdir, provider=None):
:param srvdir: path to a directory which contains a Vagrantfile :param srvdir: path to a directory which contains a Vagrantfile
:param provider: optionally this parameter allows specifiying an :param provider: optionally this parameter allows specifiying an
spesific vagrant provider. specific vagrant provider.
:returns: FDroidBuildVm instance. :returns: FDroidBuildVm instance.
""" """
abssrvdir = abspath(srvdir) abssrvdir = abspath(srvdir)
@ -163,7 +163,7 @@ class FDroidBuildVm():
Use the factory method `fdroidserver.vmtools.get_build_vm()` for Use the factory method `fdroidserver.vmtools.get_build_vm()` for
getting correct instances of this class. getting correct instances of this class.
This is intended to be a hypervisor independant, fault tolerant This is intended to be a hypervisor independent, fault tolerant
wrapper around the vagrant functions we use. wrapper around the vagrant functions we use.
""" """
def __init__(self, srvdir): def __init__(self, srvdir):
@ -184,7 +184,7 @@ class FDroidBuildVm():
global lock global lock
with lock: with lock:
try: try:
self.vgrnt.up(provision=provision) self.vgrnt.up(provision=provision, provider=self.provider)
self.srvuuid = self._vagrant_fetch_uuid() self.srvuuid = self._vagrant_fetch_uuid()
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
raise FDroidBuildVmException("could not bring up vm '%s'" % self.srvname) from e raise FDroidBuildVmException("could not bring up vm '%s'" % self.srvname) from e
@ -451,7 +451,7 @@ class LibvirtBuildVm(FDroidBuildVm):
try: try:
_check_call(['virsh', '-c', 'qemu:///system', 'snapshot-create-as', self.srvname, snapshot_name]) _check_call(['virsh', '-c', 'qemu:///system', 'snapshot-create-as', self.srvname, snapshot_name])
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
raise FDroidBuildVmException("could not cerate snapshot '%s' " raise FDroidBuildVmException("could not create snapshot '%s' "
"of libvirt vm '%s'" "of libvirt vm '%s'"
% (snapshot_name, self.srvname)) from e % (snapshot_name, self.srvname)) from e