ソースを参照

Merge pull request #151 from Dany9966/keystone-trusts-fix

Only delete keystone trust when task goes into a finalized status
Nashwan Azhari 5 年 前
コミット
ba312fc276
1 ファイル変更7 行追加6 行削除
  1. 7 6
      coriolis/conductor/rpc/server.py

+ 7 - 6
coriolis/conductor/rpc/server.py

@@ -2578,12 +2578,6 @@ class ConductorServerEndpoint(object):
             "to: %(status)s",
             "to: %(status)s",
             {"id": execution_id, "status": execution_status,
             {"id": execution_id, "status": execution_status,
              "action": execution.action_id})
              "action": execution.action_id})
-        if ctxt.delete_trust_id:
-            LOG.debug(
-                "Deleting Keystone trust following status change "
-                "for Execution '%s' (action '%s') to '%s'",
-                execution_id, execution.action_id, execution_status)
-            keystone.delete_trust(ctxt)
 
 
         if execution.type in constants.MINION_POOL_EXECUTION_TYPES:
         if execution.type in constants.MINION_POOL_EXECUTION_TYPES:
             self._update_minion_pool_status_for_finished_execution(
             self._update_minion_pool_status_for_finished_execution(
@@ -2599,6 +2593,13 @@ class ConductorServerEndpoint(object):
                 action = db_api.get_action(ctxt, execution.action_id)
                 action = db_api.get_action(ctxt, execution.action_id)
                 self._deallocate_minion_machines_for_action(
                 self._deallocate_minion_machines_for_action(
                     ctxt, action)
                     ctxt, action)
+
+                if ctxt.delete_trust_id:
+                    LOG.debug(
+                        "Deleting Keystone trust following status change "
+                        "for Execution '%s' (action '%s') to '%s'",
+                        execution_id, execution.action_id, execution_status)
+                    keystone.delete_trust(ctxt)
             else:
             else:
                 LOG.debug(
                 LOG.debug(
                     "Not deallocating minion machines for Execution '%s' "
                     "Not deallocating minion machines for Execution '%s' "