def init_host(self, host): self._serialconsoleops.start_console_handlers() event_handler = eventhandler.InstanceEventHandler( state_change_callback=self.emit_event) event_handler.start_listener() instance_path = self._pathutils.get_instances_dir() self._pathutils.check_create_dir(instance_path)
def setUp(self, mock_get_vmutils): super(EventHandlerTestCase, self).setUp() self._state_change_callback = mock.Mock() self.flags( power_state_check_timeframe=self._FAKE_EVENT_CHECK_TIMEFRAME, group='hyperv') self.flags( power_state_event_polling_interval=self._FAKE_POLLING_INTERVAL, group='hyperv') self._event_handler = eventhandler.InstanceEventHandler( self._state_change_callback) self._event_handler._serial_console_ops = mock.Mock()
def init_host(self, host): self._serialconsoleops.start_console_handlers() event_handler = eventhandler.InstanceEventHandler( state_change_callback=self.emit_event) event_handler.start_listener()