def delete(self, id): """Delete the specified action_execution. :param id: UUID of action execution to delete """ acl.enforce('action_executions:delete', context.ctx()) LOG.debug("Delete action_execution [id=%s]", id) if not cfg.CONF.api.allow_action_execution_deletion: raise exc.NotAllowedException("Action execution deletion is not " "allowed.") with db_api.transaction(): action_ex = db_api.get_action_execution(id) if action_ex.task_execution_id: raise exc.NotAllowedException( "Only ad-hoc action execution can be deleted.") if not states.is_completed(action_ex.state): raise exc.NotAllowedException( "Only completed action execution can be deleted.") return db_api.delete_action_execution(id)
def delete(self, id): """Delete the specified action_execution. :param id: UUID of action execution to delete """ acl.enforce('action_executions:delete', context.ctx()) LOG.debug("Delete action_execution [id=%s]", id) if not cfg.CONF.api.allow_action_execution_deletion: raise exc.NotAllowedException("Action execution deletion is not " "allowed.") with db_api.transaction(): action_ex = db_api.get_action_execution(id) if action_ex.task_execution_id: raise exc.NotAllowedException( "Only ad-hoc action execution can be deleted." ) if not states.is_completed(action_ex.state): raise exc.NotAllowedException( "Only completed action execution can be deleted." ) return db_api.delete_action_execution(id)
def delete(self, id): """Delete the specified action_execution.""" LOG.info("Delete action_execution [id=%s]" % id) if not cfg.CONF.api.allow_action_execution_deletion: raise exc.NotAllowedException("Action execution deletion is not " "allowed.") action_ex = db_api.get_action_execution(id) if action_ex.task_execution_id: raise exc.NotAllowedException("Only ad-hoc action execution can " "be deleted.") if not states.is_completed(action_ex.state): raise exc.NotAllowedException("Only completed action execution " "can be deleted.") return db_api.delete_action_execution(id)
def delete(self, id): """Delete the specified action_execution.""" LOG.info("Delete action_execution [id=%s]" % id) if not cfg.CONF.api.allow_action_execution_deletion: raise exc.NotAllowedException("Action execution deletion is not " "allowed.") action_ex = db_api.get_action_execution(id) if action_ex.task_execution_id: raise exc.NotAllowedException("Only ad-hoc action execution can " "be deleted.") if not states.is_completed(action_ex.state): raise exc.NotAllowedException("Only completed action execution " "can be deleted.") return db_api.delete_action_execution(id)