]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
heat DB : make watch_data_get_all work with no watch ID
authorSteven Hardy <shardy@redhat.com>
Wed, 22 Aug 2012 19:14:11 +0000 (20:14 +0100)
committerSteven Hardy <shardy@redhat.com>
Thu, 23 Aug 2012 17:31:21 +0000 (18:31 +0100)
Align watch_data_get_all with other "all" methods, and
return all watch data without requiring an ID.  We may
also need by_id and by_name variants but this is more
consistent and makes things easier for cloudwatch.

Change-Id: I09c90278349efc769ab7c719f686a1fd854b425a
Signed-off-by: Steven Hardy <shardy@redhat.com>
heat/db/api.py
heat/db/sqlalchemy/api.py

index d67bd2e2603a650b7d648f7200eee3d0414a7bdc..3c3ca44dba416c38f5205588fdb216678e5ff02d 100644 (file)
@@ -163,8 +163,8 @@ def watch_data_create(context, values):
     return IMPL.watch_data_create(context, values)
 
 
-def watch_data_get_all(context, watch_id):
-    return IMPL.watch_data_get_all(context, watch_id)
+def watch_data_get_all(context):
+    return IMPL.watch_data_get_all(context)
 
 
 def watch_data_delete(context, watch_name):
index 09ab1cf5166bda27a1492e5fddcbc355c1085ce1..9f53a979b05f53490967f5c5e369cb61dc85433d 100644 (file)
@@ -298,10 +298,8 @@ def watch_data_create(context, values):
     return obj_ref
 
 
-def watch_data_get_all(context, watch_id):
-    # get dataset ordered by creation_at (most recient first)
-    results = model_query(context, models.WatchData).\
-                          filter_by(watch_rule_id=watch_id).all()
+def watch_data_get_all(context):
+    results = model_query(context, models.WatchData).all()
     return results