summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-06-16 11:21:54 +0000
committerGerrit Code Review <review@openstack.org>2017-06-16 11:21:54 +0000
commit49ec3cb3fa0ad950a5762bb990edfc7ff6e4dbf8 (patch)
treedb0ddcfad01fea85d8b0ee4d1491665725dcc9dd
parent3fdc5cad79f42ab88ce19ece6dd3d0d457d1b70e (diff)
parent4377e0d5ab38d09dfe41d1115ab0e4610ec48a10 (diff)
Merge "fix the function named get_count_all"
-rw-r--r--magnum/objects/cluster.py13
-rw-r--r--magnum/tests/unit/objects/test_objects.py2
2 files changed, 12 insertions, 3 deletions
diff --git a/magnum/objects/cluster.py b/magnum/objects/cluster.py
index 5b1c04b..eed3bec 100644
--- a/magnum/objects/cluster.py
+++ b/magnum/objects/cluster.py
@@ -139,8 +139,17 @@ class Cluster(base.MagnumPersistentObject, base.MagnumObject,
139 return cluster 139 return cluster
140 140
141 @base.remotable_classmethod 141 @base.remotable_classmethod
142 def get_count_all(cls, context, **kwargs): 142 def get_count_all(cls, context, filters=None):
143 return cls.dbapi.get_cluster_count_all(context, **kwargs) 143 """Get count of matching clusters.
144
145 :param context: The security context
146 :param filters: filter dict, can includes 'cluster_template_id',
147 'name', 'node_count', 'stack_id', 'api_address',
148 'node_addresses', 'project_id', 'user_id',
149 'status'(should be a status list), 'master_count'.
150 :returns: Count of matching clusters.
151 """
152 return cls.dbapi.get_cluster_count_all(context, filters=filters)
144 153
145 @base.remotable_classmethod 154 @base.remotable_classmethod
146 def get_by_name(cls, context, name): 155 def get_by_name(cls, context, name):
diff --git a/magnum/tests/unit/objects/test_objects.py b/magnum/tests/unit/objects/test_objects.py
index 64d3921..c9b08fb 100644
--- a/magnum/tests/unit/objects/test_objects.py
+++ b/magnum/tests/unit/objects/test_objects.py
@@ -355,7 +355,7 @@ class TestObject(test_base.TestCase, _TestObject):
355# For more information on object version testing, read 355# For more information on object version testing, read
356# http://docs.openstack.org/developer/magnum/objects.html 356# http://docs.openstack.org/developer/magnum/objects.html
357object_data = { 357object_data = {
358 'Cluster': '1.13-87f9b6ff2090663d69a1de2e95c50a27', 358 'Cluster': '1.13-5da08d5f023eab4c5657c3fb6997e44c',
359 'ClusterTemplate': '1.17-74e4e6b1faca768714be809a828599c2', 359 'ClusterTemplate': '1.17-74e4e6b1faca768714be809a828599c2',
360 'Certificate': '1.1-1924dc077daa844f0f9076332ef96815', 360 'Certificate': '1.1-1924dc077daa844f0f9076332ef96815',
361 'MyObj': '1.0-34c4b1aadefd177b13f9a2f894cc23cd', 361 'MyObj': '1.0-34c4b1aadefd177b13f9a2f894cc23cd',