vmtools: Properly initialize provider member

This commit is contained in:
Jochen Sprickerhof 2023-03-21 14:00:58 +01:00
parent 0136872154
commit 2a5b127773
No known key found for this signature in database
GPG Key ID: 5BFFDCC258E69433

View File

@ -197,9 +197,9 @@ class FDroidBuildVm:
wrapper around the vagrant functions we use. wrapper around the vagrant functions we use.
""" """
def __init__(self, srvdir): def __init__(self, srvdir, provider=None):
"""Create new server class.""" """Create new server class."""
self.provider = None self.provider = provider
self.srvdir = srvdir self.srvdir = srvdir
self.srvname = basename(srvdir) + '_default' self.srvname = basename(srvdir) + '_default'
self.vgrntfile = os.path.join(srvdir, 'Vagrantfile') self.vgrntfile = os.path.join(srvdir, 'Vagrantfile')
@ -377,8 +377,7 @@ class FDroidBuildVm:
class LibvirtBuildVm(FDroidBuildVm): class LibvirtBuildVm(FDroidBuildVm):
def __init__(self, srvdir): def __init__(self, srvdir):
self.provider = 'libvirt' super().__init__(srvdir, 'libvirt')
super().__init__(srvdir)
import libvirt import libvirt
try: try:
@ -428,5 +427,4 @@ class LibvirtBuildVm(FDroidBuildVm):
class VirtualboxBuildVm(FDroidBuildVm): class VirtualboxBuildVm(FDroidBuildVm):
def __init__(self, srvdir): def __init__(self, srvdir):
self.provider = 'virtualbox' super().__init__(srvdir, 'virtualbox')
super().__init__(srvdir)