Added strategy ID + Action Plan syncing
In this changeset, I implemented the logic which cancels any audit or action plan whose goal has been re-synced (upon restarting the Decision Engine). Partially Implements: blueprint efficacy-indicator Change-Id: I95d2739eb552d4a7a02c822b11844591008f648e
This commit is contained in:
@@ -48,10 +48,11 @@ class DefaultPlanner(base.BasePlanner):
|
||||
|
||||
@classmethod
|
||||
def get_config_opts(cls):
|
||||
return [cfg.DictOpt(
|
||||
'weights',
|
||||
help="These weights are used to schedule the actions",
|
||||
default=cls.weights_dict),
|
||||
return [
|
||||
cfg.DictOpt(
|
||||
'weights',
|
||||
help="These weights are used to schedule the actions",
|
||||
default=cls.weights_dict),
|
||||
]
|
||||
|
||||
def create_action(self,
|
||||
@@ -113,9 +114,13 @@ class DefaultPlanner(base.BasePlanner):
|
||||
return action_plan
|
||||
|
||||
def _create_action_plan(self, context, audit_id, solution):
|
||||
strategy = objects.Strategy.get_by_name(
|
||||
context, solution.strategy.name)
|
||||
|
||||
action_plan_dict = {
|
||||
'uuid': utils.generate_uuid(),
|
||||
'audit_id': audit_id,
|
||||
'strategy_id': strategy.id,
|
||||
'first_action_id': None,
|
||||
'state': objects.action_plan.State.RECOMMENDED,
|
||||
'global_efficacy': solution.global_efficacy,
|
||||
|
||||
Reference in New Issue
Block a user