From dbdf690cd0442a5099ef15375a379ce7400fdb84 Mon Sep 17 00:00:00 2001 From: Tin Lam Date: Thu, 12 May 2016 18:50:30 -0500 Subject: [PATCH] Remove direct access to dbapi In line [1], we directly use the dbapi in order to filter the actions by action_plan_id. [1] https://github.com/openstack/watcher/blob/master/watcher/applier/default.py#L63 Change-Id: I2c75528f619a5277d46702cc3b4ca4bc7280f990 Closes-Bug: #1534170 --- watcher/applier/default.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/watcher/applier/default.py b/watcher/applier/default.py index ac1c7810c..1374623c7 100644 --- a/watcher/applier/default.py +++ b/watcher/applier/default.py @@ -56,9 +56,7 @@ class DefaultApplier(base.BaseApplier): def execute(self, action_plan_uuid): LOG.debug("Executing action plan %s ", action_plan_uuid) - action_plan = objects.ActionPlan.get_by_uuid(self.context, - action_plan_uuid) - # todo(jed) remove direct access to dbapi need filter in object - filters = {'action_plan_id': action_plan.id} - actions = objects.Action.dbapi.get_action_list(self.context, filters) + filters = {'action_plan_uuid': action_plan_uuid} + actions = objects.Action.list(self.context, + filters=filters) return self.engine.execute(actions)