diff --git a/watcher/applier/default.py b/watcher/applier/default.py old mode 100644 new mode 100755 index 62b5dce36..aac85d689 --- a/watcher/applier/default.py +++ b/watcher/applier/default.py @@ -58,5 +58,6 @@ class DefaultApplier(base.BaseApplier): LOG.debug("Executing action plan %s ", action_plan_uuid) filters = {'action_plan_uuid': action_plan_uuid} - actions = objects.Action.list(self.context, filters=filters) + actions = objects.Action.list(self.context, filters=filters, + eager=True) return self.engine.execute(actions) diff --git a/watcher/tests/applier/action_plan/test_default_action_handler.py b/watcher/tests/applier/action_plan/test_default_action_handler.py old mode 100644 new mode 100755 index 94827d738..6949416d9 --- a/watcher/tests/applier/action_plan/test_default_action_handler.py +++ b/watcher/tests/applier/action_plan/test_default_action_handler.py @@ -40,9 +40,16 @@ class TestDefaultActionPlanHandler(base.DbTestCase): self.addCleanup(p_action_plan_notifications.stop) obj_utils.create_test_goal(self.context) - obj_utils.create_test_strategy(self.context) - obj_utils.create_test_audit(self.context) - self.action_plan = obj_utils.create_test_action_plan(self.context) + self.strategy = obj_utils.create_test_strategy(self.context) + self.audit = obj_utils.create_test_audit( + self.context, strategy_id=self.strategy.id) + self.action_plan = obj_utils.create_test_action_plan( + self.context, audit_id=self.audit.id, + strategy_id=self.strategy.id) + self.action = obj_utils.create_test_action( + self.context, action_plan_id=self.action_plan.id, + action_type='nop', + input_parameters={'message': 'hello World'}) @mock.patch.object(objects.ActionPlan, "get_by_uuid") def test_launch_action_plan(self, m_get_action_plan):