Merge "fix the function named get_count_all"

This commit is contained in:
Jenkins 2017-06-16 11:21:54 +00:00 committed by Gerrit Code Review
commit 49ec3cb3fa
2 changed files with 12 additions and 3 deletions

View File

@ -139,8 +139,17 @@ class Cluster(base.MagnumPersistentObject, base.MagnumObject,
return cluster
@base.remotable_classmethod
def get_count_all(cls, context, **kwargs):
return cls.dbapi.get_cluster_count_all(context, **kwargs)
def get_count_all(cls, context, filters=None):
"""Get count of matching clusters.
:param context: The security context
:param filters: filter dict, can includes 'cluster_template_id',
'name', 'node_count', 'stack_id', 'api_address',
'node_addresses', 'project_id', 'user_id',
'status'(should be a status list), 'master_count'.
:returns: Count of matching clusters.
"""
return cls.dbapi.get_cluster_count_all(context, filters=filters)
@base.remotable_classmethod
def get_by_name(cls, context, name):

View File

@ -355,7 +355,7 @@ class TestObject(test_base.TestCase, _TestObject):
# For more information on object version testing, read
# http://docs.openstack.org/developer/magnum/objects.html
object_data = {
'Cluster': '1.13-87f9b6ff2090663d69a1de2e95c50a27',
'Cluster': '1.13-5da08d5f023eab4c5657c3fb6997e44c',
'ClusterTemplate': '1.17-74e4e6b1faca768714be809a828599c2',
'Certificate': '1.1-1924dc077daa844f0f9076332ef96815',
'MyObj': '1.0-34c4b1aadefd177b13f9a2f894cc23cd',