Просмотр исходного кода

Merged in aznashwan/coriolis-core/no-executions-error (pull request #128)

Raise explicit error when trying to deploy an executionless replica.
Nashwan Azhari 7 лет назад
Родитель
Сommit
284f0f65c7
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      coriolis/conductor/rpc/server.py

+ 3 - 0
coriolis/conductor/rpc/server.py

@@ -427,6 +427,9 @@ class ConductorServerEndpoint(object):
     def _check_valid_replica_tasks_execution(replica, force=False):
         sorted_executions = sorted(
             replica.executions, key=lambda e: e.number, reverse=True)
+        if not sorted_executions:
+            raise exception.InvalidReplicaState(
+                "The Replica has never been executed.")
 
         if (force and sorted_executions[0].status !=
                 constants.EXECUTION_STATUS_COMPLETED):