def __init__(self): if not HAVE_LIBVIRT: raise CuckooDependencyError( "The libvirt package has not been installed " "(`pip install libvirt-python`)") super(LibVirtMachinery, self).__init__()
def _initialize_check(self): """Check XenServer configuration, initialize a Xen API connection, and verify machine validity. """ self._sessions = {} if not HAVE_XENAPI: raise CuckooDependencyError("Unable to import XenAPI") if not self.options.xenserver.user: raise CuckooMachineError("XenServer username missing, please add " "it to xenserver.conf.") if not self.options.xenserver.password: raise CuckooMachineError("XenServer password missing, please add " "it to xenserver.conf") if not self.options.xenserver.url: raise CuckooMachineError("XenServer url missing, please add it to " "xenserver.conf") self._make_xenapi_session() for machine in self.machines(): uuid = machine.label (ref, vm) = self._check_vm(uuid) if machine.snapshot: self._check_snapshot(uuid, machine.snapshot) else: self._check_disks_reset(vm) super(XenServer, self)._initialize_check()
def __init__(self): if not HAVE_PYVMOMI: raise CuckooDependencyError( "Couldn't import pyVmomi, please install it (using " "`pip install -U pyvmomi`)" ) super(vSphere, self).__init__()