Merge "Add is_profile_only to Cluster resource"

This commit is contained in:
Jenkins 2017-04-17 12:25:35 +00:00 committed by Gerrit Code Review
commit ea266f8d77
2 changed files with 13 additions and 1 deletions

View File

@ -30,7 +30,7 @@ class Cluster(resource.Resource):
patch_update = True
_query_mapping = resource.QueryParameters(
'name', 'status', 'sort', 'global_project', 'profile_only')
'name', 'status', 'sort', 'global_project')
# Properties
#: The name of the cluster.
@ -74,6 +74,8 @@ class Cluster(resource.Resource):
node_ids = resource.Body('nodes')
#: Name of the profile used by the cluster.
profile_name = resource.Body('profile_name')
#: Specify whether the cluster update should only pertain to the profile.
is_profile_only = resource.Body('profile_only', type=bool)
#: A dictionary with dependency information of the cluster
dependents = resource.Body('dependents', type=dict)

View File

@ -26,6 +26,7 @@ FAKE = {
'min_size': 0,
'name': FAKE_NAME,
'profile_id': 'myserver',
'profile_only': True,
'metadata': {},
'dependents': {},
'timeout': None,
@ -99,6 +100,15 @@ class TestCluster(testtools.TestCase):
self.assertEqual(FAKE['created_at'], sot.created_at)
self.assertEqual(FAKE['updated_at'], sot.updated_at)
self.assertEqual(FAKE['dependents'], sot.dependents)
self.assertTrue(sot.is_profile_only)
self.assertDictEqual({"limit": "limit",
"marker": "marker",
"name": "name",
"status": "status",
"sort": "sort",
"global_project": "global_project"},
sot._query_mapping._mapping)
def test_scale_in(self):
sot = cluster.Cluster(**FAKE)