From a684e70b61a000ec8344cbc6cf7961859c300362 Mon Sep 17 00:00:00 2001
From: licanwei
Date: Thu, 1 Sep 2016 16:58:56 +0800
Subject: [PATCH] When action plan is empty, its state is incorrect
When the action plan is empty,its state is still 'RECOMMENDED'.
I think it's should be 'SUCCEED'.
Closes-Bug: #1619155
Change-Id: Icd10707c7892089999f8b37775ca62bde47db0c4
---
watcher/decision_engine/planner/default.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/watcher/decision_engine/planner/default.py b/watcher/decision_engine/planner/default.py
index 7662d61be..ac384661e 100644
--- a/watcher/decision_engine/planner/default.py
+++ b/watcher/decision_engine/planner/default.py
@@ -94,6 +94,7 @@ class DefaultPlanner(base.BasePlanner):
if len(scheduled) == 0:
LOG.warning(_LW("The action plan is empty"))
action_plan.first_action_id = None
+ action_plan.state = objects.action_plan.State.SUCCEEDED
action_plan.save()
else:
# create the first action