Add Action Notification
This patch set adds the following action notifications: - action.create - action.update - action.delete - action.execution.start - action.execution.end - action.execution.error Partially Implements: blueprint action-versioned-notifications-api Change-Id: If0bc25bfb7cb1bff3bfa2c5d5fb9ad48b0794168
This commit is contained in:
committed by
alexchadin
parent
62cb8a8d29
commit
25789c9c5a
@@ -84,18 +84,6 @@ class WeightPlanner(base.BasePlanner):
|
||||
default=cls.parallelization),
|
||||
]
|
||||
|
||||
@staticmethod
|
||||
def format_action(action_plan_id, action_type,
|
||||
input_parameters=None, parents=()):
|
||||
return {
|
||||
'uuid': utils.generate_uuid(),
|
||||
'action_plan_id': int(action_plan_id),
|
||||
'action_type': action_type,
|
||||
'input_parameters': input_parameters,
|
||||
'state': objects.action.State.PENDING,
|
||||
'parents': parents or None,
|
||||
}
|
||||
|
||||
@staticmethod
|
||||
def chunkify(lst, n):
|
||||
"""Yield successive n-sized chunks from lst."""
|
||||
@@ -168,7 +156,7 @@ class WeightPlanner(base.BasePlanner):
|
||||
action_plan.state = objects.action_plan.State.SUCCEEDED
|
||||
action_plan.save()
|
||||
|
||||
self.create_scheduled_actions(action_plan, action_graph)
|
||||
self.create_scheduled_actions(action_graph)
|
||||
return action_plan
|
||||
|
||||
def get_sorted_actions_by_weight(self, context, action_plan, solution):
|
||||
@@ -187,7 +175,7 @@ class WeightPlanner(base.BasePlanner):
|
||||
|
||||
return reversed(sorted(weighted_actions.items(), key=lambda x: x[0]))
|
||||
|
||||
def create_scheduled_actions(self, action_plan, graph):
|
||||
def create_scheduled_actions(self, graph):
|
||||
for action in graph.nodes():
|
||||
LOG.debug("Creating the %s in the Watcher database",
|
||||
action.action_type)
|
||||
|
||||
Reference in New Issue
Block a user