slave.vm package

Submodules

slave.vm.bootstrap module

class slave.vm.bootstrap.HostComms(recv_callback, job_id, job_idx, tool, dev=False)[source]

Bases: threading.Thread

run()[source]
send_msg(type, data)[source]
stop()[source]
class slave.vm.bootstrap.TalusBootstrap(config_path, dev=False)[source]

Bases: object

The main class that will bootstrap the job and get things running

run()[source]
class slave.vm.bootstrap.TalusCodeImporter(loc, username, password, parent_log=None)[source]

Bases: object

This class will dynamically import tools and components from the talus git repository.

This class should conform to “pep-302”:https://www.python.org/dev/peps/pep-0302/

download_module(abs_name)[source]

Download the module found at abs_name from the talus git repository

Parameters:abs_name (str) – The absolute module name of the module to be downloaded
find_module(abs_name, path=None)[source]

Normally, a finder object would return a loader that can load the module. In our case, we’re going to be sneaky and just download the files and return None and let the normal sys.path-type loading take place.

This method is cleaner and less error prone

Parameters:abs_name (str) – The absolute name of the module to be imported
slave.vm.bootstrap.main(dev=False)[source]

Module contents

class slave.vm.ImageManager[source]

Bases: object

download_image(image_id)[source]

Download the image from the image_url

ensure_image(image_id)[source]

Ensure that the image image_id and its bases exist in LIBVIRT_BASE checking its md5 against the md5 sum stored in the database

Returns:True/False on success
get_md5(path)[source]

Get the md5 of the file at path. A cache will be used based on last modified time of the file. If the file does not exist, None will be returned.

classmethod instance()[source]
class slave.vm.VMHandler(job, idx, image, image_username, image_password, tool, params, code_loc, code_username, code_password, timeout=600, network='whitelist', on_finished=None, on_vnc_available=None, startup_timeout=60)[source]

Bases: threading.Thread

handle_comms(data)[source]

Handle guest communications

handle_guest_startup(data)[source]
run()[source]

Run the VMHandler

stop()[source]
slave.vm.image_id_to_volume(image)[source]
slave.vm.qemu_img_info(image_path)[source]

Return a dict of info returned by qemu-img info. Assumes the image_path exists and points to a valid VM image

Image_path:path to the image
Returns:dict of returned information about the image