fdroidserver.vmtools module

class fdroidserver.vmtools.FDroidBuildVm(srvdir, provider=None)

Bases: object

Abstract base class for working with FDroids build-servers.

Use the factory method fdroidserver.vmtools.get_build_vm() for getting correct instances of this class.

This is intended to be a hypervisor independent, fault tolerant wrapper around the vagrant functions we use.

Methods

box_add(boxname, boxfile[, force])

Add vagrant box to vagrant.

destroy()

Remove every trace of this VM from the system.

sshinfo()

Get ssh connection info for a vagrant VM.

vagrant_uuid_okay()

Having an uuid means that vagrant up has run successfully.

box_remove

halt

suspend

up

box_add(boxname, boxfile, force=True)

Add vagrant box to vagrant.

Parameters:
boxname

name assigned to local deployment of box

boxfile

path to box file

force

overwrite existing box image (default: True)

box_remove(boxname)
destroy()

Remove every trace of this VM from the system.

This includes deleting: * hypervisor specific definitions * vagrant state informations (eg. .vagrant folder) * images related to this vm

halt()
sshinfo()

Get ssh connection info for a vagrant VM.

Returns:
A dictionary containing ‘hostname’, ‘port’, ‘user’ and ‘idfile’
suspend()
up(provision=True)
vagrant_uuid_okay()

Having an uuid means that vagrant up has run successfully.

exception fdroidserver.vmtools.FDroidBuildVmException(value=None, detail=None)

Bases: FDroidException

class fdroidserver.vmtools.LibvirtBuildVm(srvdir)

Bases: FDroidBuildVm

Methods

box_add(boxname, boxfile[, force])

Add vagrant box to vagrant.

destroy()

Remove every trace of this VM from the system.

sshinfo()

Get ssh connection info for a vagrant VM.

vagrant_uuid_okay()

Having an uuid means that vagrant up has run successfully.

box_remove

halt

suspend

up

box_add(boxname, boxfile, force=True)

Add vagrant box to vagrant.

Parameters:
boxname

name assigned to local deployment of box

boxfile

path to box file

force

overwrite existing box image (default: True)

box_remove(boxname)
destroy()

Remove every trace of this VM from the system.

This includes deleting: * hypervisor specific definitions * vagrant state informations (eg. .vagrant folder) * images related to this vm

class fdroidserver.vmtools.VirtualboxBuildVm(srvdir)

Bases: FDroidBuildVm

Methods

box_add(boxname, boxfile[, force])

Add vagrant box to vagrant.

destroy()

Remove every trace of this VM from the system.

sshinfo()

Get ssh connection info for a vagrant VM.

vagrant_uuid_okay()

Having an uuid means that vagrant up has run successfully.

box_remove

halt

suspend

up

fdroidserver.vmtools.get_build_vm(srvdir, provider=None)

No summary.

Factory function for getting FDroidBuildVm instances.

This function tries to figure out what hypervisor should be used and creates an object for controlling a build VM.

Parameters:
srvdir

path to a directory which contains a Vagrantfile

provider

optionally this parameter allows specifiying an specific vagrant provider.

Returns:
FDroidBuildVm instance.
fdroidserver.vmtools.get_clean_builder(serverdir)