def __init__(self, config): xmlrpc.XMLRPC.__init__(self) self._config = config self._hvController = ControllerFactory.createController(config) self._createHVControllerMethods() self._initializeIdsToNamesMapping() #sets self._idToNames self._initializeNamesToIdsMapping() #sets self._namesToIds
def test_createVirtualBoxController(self): cfg = \ """ [Hypervisor] hypervisor=VirtualBox hypervisor_helpers_path= """ configFile = StringIO(cfg) self.config = SafeConfigParser() self.config.readfp(configFile) configFile.close() controller = ControllerFactory.createController(self.config) self.assertTrue(controller) self.assertEqual( controller._controller, VirtualBox)
def __init__(self, config): msgInterpreter = MsgInterpreter.MsgInterpreter(self) BaseStompEngine.BaseStompEngine.__init__(self, msgInterpreter) self._hvController = ControllerFactory.createController(config) self._vms = {} self._pings = {} self._cmdReqsSent = {} #cmdId: dict with keys (timestamp, to, cmd, args, env, path) self._cmdReqsRetired = {} #finished cmdReqsSent self._cmdReqsRcvd = {} self._chirpPath = config.get('Host', 'chirp_path') grace = int(config.get('Host', 'vm_gc_grace')) self._vmsChecker = LoopingCall( self._performVMsGC, grace) self._vmsChecker.start( grace, now=False) #FIXME: make it return stuff, instead of having side effects self._initializeIdsToNamesMapping() #sets self._idsToNames