def setUp(self): super(MaintenanceThreadTestCase, self).setUp() row = models.OpendaylightMaintenance(state=odl_const.PENDING) self.db_session.add(row) self.db_session.flush() self.thread = maintenance.MaintenanceThread() self.thread.maintenance_interval = 0.01 self.addCleanup(self.thread.cleanup)
def _start_maintenance_thread(self): # start the maintenance thread and register all the maintenance # operations : # (1) JournalCleanup - Delete completed rows from journal # (2) CleanupProcessing - Mark orphaned processing rows to pending cleanup_obj = cleanup.JournalCleanup() self._maintenance_thread = maintenance.MaintenanceThread() self._maintenance_thread.register_operation( cleanup_obj.delete_completed_rows) self._maintenance_thread.register_operation( cleanup_obj.cleanup_processing_rows) self._maintenance_thread.start()
def _start_maintenance_thread(self): # start the maintenance thread and register all the maintenance # operations : # (1) JournalCleanup - Delete completed rows from journal # (2) CleanupProcessing - Mark orphaned processing rows to pending # (3) Full sync - Re-sync when detecting an ODL "cold reboot" cleanup_obj = cleanup.JournalCleanup() self._maintenance_thread = maintenance.MaintenanceThread() self._maintenance_thread.register_operation( cleanup_obj.delete_completed_rows) self._maintenance_thread.register_operation( cleanup_obj.cleanup_processing_rows) self._maintenance_thread.register_operation(full_sync.full_sync) self._maintenance_thread.start()
def _start_maintenance_thread(self, poll_interval): self._mainth = mt.MaintenanceThread() self._mainth.maintenance_interval = poll_interval self._mainth.register_operation(self._get_and_update_hostconfigs) self._mainth.start()