Alessandro Pilotti 10 лет назад
Родитель
Сommit
4f372114e6
2 измененных файлов с 6 добавлено и 6 удалено
  1. 4 4
      coriolis/conductor/rpc/server.py
  2. 2 2
      coriolis/constants.py

+ 4 - 4
coriolis/conductor/rpc/server.py

@@ -26,7 +26,7 @@ class ConductorServerEndpoint(object):
     def migrate_instances(self, ctxt, origin, destination, instances):
         migration = models.Migration()
         migration.id = str(uuid.uuid4())
-        migration.status = constants.MIGRATION_STATUS_STARTED
+        migration.status = constants.MIGRATION_STATUS_RUNNING
         migration.origin = origin
         migration.destination = destination
 
@@ -71,7 +71,7 @@ class ConductorServerEndpoint(object):
     def delete_migration(self, ctxt, migration_id):
         migration = self._get_migration(ctxt, migration_id)
         for task in migration.tasks:
-            if task.status == constants.TASK_STATUS_STARTED:
+            if task.status == constants.TASK_STATUS_RUNNING:
                 raise exception.CoriolisException(
                     "Cannot delete a running migration")
         db_api.delete_migration(ctxt, migration_id)
@@ -79,14 +79,14 @@ class ConductorServerEndpoint(object):
     def stop_instances_migration(self, ctxt, migration_id):
         migration = self._get_migration(ctxt, migration_id)
         for task in migration.tasks:
-            if task.status == constants.TASK_STATUS_STARTED:
+            if task.status == constants.TASK_STATUS_RUNNING:
                 self._rpc_worker_client.stop_task(
                     ctxt, task.host, task.process_id)
 
     def set_task_host(self, ctxt, task_id, host, process_id):
         db_api.set_task_host(ctxt, task_id, host, process_id)
         db_api.set_task_status(
-            ctxt, task_id, constants.TASK_STATUS_STARTED)
+            ctxt, task_id, constants.TASK_STATUS_RUNNING)
 
     def _start_pending_tasks(self, ctxt, migration, parent_task, task_info):
         has_pending_tasks = False

+ 2 - 2
coriolis/constants.py

@@ -1,9 +1,9 @@
-MIGRATION_STATUS_STARTED = "STARTED"
+MIGRATION_STATUS_RUNNING = "RUNNING"
 MIGRATION_STATUS_COMPLETED = "COMPLETED"
 MIGRATION_STATUS_ERROR = "ERROR"
 
 TASK_STATUS_PENDING = "PENDING"
-TASK_STATUS_STARTED = "STARTED"
+TASK_STATUS_RUNNING = "RUNNING"
 TASK_STATUS_COMPLETED = "COMPLETED"
 TASK_STATUS_ERROR = "ERROR"
 TASK_STATUS_CANCELED = "CANCELED"