diff --git a/karbor/common/constants.py b/karbor/common/constants.py index 11e88707..1b1d6b53 100644 --- a/karbor/common/constants.py +++ b/karbor/common/constants.py @@ -82,7 +82,6 @@ RESOURCE_STATUS_UNDEFINED = 'undefined' # scheduled operation state OPERATION_STATE_INIT = 'init' OPERATION_STATE_REGISTERED = 'registered' -OPERATION_STATE_TRIGGERED = 'triggered' OPERATION_STATE_RUNNING = 'running' OPERATION_STATE_DELETED = 'deleted' diff --git a/karbor/services/operationengine/engine/executors/green_thread_executor.py b/karbor/services/operationengine/engine/executors/green_thread_executor.py index 991a0a51..aeba01c7 100644 --- a/karbor/services/operationengine/engine/executors/green_thread_executor.py +++ b/karbor/services/operationengine/engine/executors/green_thread_executor.py @@ -63,7 +63,7 @@ class GreenThreadExecutor(base.BaseExecutor): end_time_for_run = expect_start_time + timedelta(seconds=window_time) ret = self._update_operation_state( operation_id, - {'state': constants.OPERATION_STATE_TRIGGERED, + {'state': constants.OPERATION_STATE_RUNNING, 'end_time_for_run': end_time_for_run}) if not ret: self._operation_thread_map.pop(operation_id, None) @@ -132,10 +132,6 @@ class GreenThreadExecutor(base.BaseExecutor): def _run_operation(self, operation_id, param): - self._update_operation_state( - operation_id, - {'state': constants.OPERATION_STATE_RUNNING}) - try: try: operation = objects.ScheduledOperation.get_by_id( diff --git a/karbor/services/operationengine/engine/executors/scheduled_operation_executor.py b/karbor/services/operationengine/engine/executors/scheduled_operation_executor.py index d36bdefa..f68e65a7 100644 --- a/karbor/services/operationengine/engine/executors/scheduled_operation_executor.py +++ b/karbor/services/operationengine/engine/executors/scheduled_operation_executor.py @@ -43,7 +43,7 @@ class ScheduledOperationExecutor(base.BaseExecutor): end_time_for_run = expect_start_time + timedelta(seconds=window_time) ret = self._update_operation_state( operation_id, - {'state': constants.OPERATION_STATE_TRIGGERED, + {'state': constants.OPERATION_STATE_RUNNING, 'end_time_for_run': end_time_for_run}) if not ret: return @@ -75,10 +75,6 @@ class ScheduledOperationExecutor(base.BaseExecutor): def _run_operation(self, operation_id, param): - self._update_operation_state( - operation_id, - {'state': constants.OPERATION_STATE_RUNNING}) - try: check_item = [self._CHECK_ITEMS['is_canceled']] if self._check_operation(operation_id, check_item): diff --git a/karbor/services/operationengine/manager.py b/karbor/services/operationengine/manager.py index 50d9ff47..c1b5029e 100644 --- a/karbor/services/operationengine/manager.py +++ b/karbor/services/operationengine/manager.py @@ -125,12 +125,10 @@ class OperationEngineManager(manager.Manager): marker = None filters = {"service_id": self._service_id, "state": [constants.OPERATION_STATE_REGISTERED, - constants.OPERATION_STATE_TRIGGERED, constants.OPERATION_STATE_RUNNING]} columns_to_join = ['operation'] ctxt = karbor_context.get_admin_context() - resume_states = [constants.OPERATION_STATE_TRIGGERED, - constants.OPERATION_STATE_RUNNING] + resume_states = [constants.OPERATION_STATE_RUNNING, ] while True: states = objects.ScheduledOperationStateList.get_by_filters( ctxt, filters, limit, marker, columns_to_join=columns_to_join)