From 77c16733feeb25ec21b57d94acd6ca5e54e3cb71 Mon Sep 17 00:00:00 2001 From: Vilobh Meshram Date: Tue, 17 Nov 2015 15:14:45 -0800 Subject: [PATCH] Fix RC CLI to work with Object from Bay changes Fix RC CLI to work with Object from Bay changes. In the list API explicitly pass the bay_ident for which the query is supposed to be made. Change-Id: I6093b0e062b72471abc32b968076dcec67e6d6dd Partially-Implements: bp objects-from-bay --- magnumclient/tests/v1/test_replicationcontrollers.py | 2 +- magnumclient/v1/replicationcontrollers.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/magnumclient/tests/v1/test_replicationcontrollers.py b/magnumclient/tests/v1/test_replicationcontrollers.py index 5fd413a0..3448decf 100644 --- a/magnumclient/tests/v1/test_replicationcontrollers.py +++ b/magnumclient/tests/v1/test_replicationcontrollers.py @@ -105,7 +105,7 @@ class RCManagerTest(testtools.TestCase): def test_rc_list(self): rcs = self.mgr.list(RC1['bay_uuid']) expect = [ - ('GET', '/v1/rcs', {}, None), + ('GET', '/v1/rcs/?bay_ident=%s' % (RC1['bay_uuid']), {}, None), ] self.assertEqual(expect, self.api.calls) self.assertThat(rcs, matchers.HasLength(2)) diff --git a/magnumclient/v1/replicationcontrollers.py b/magnumclient/v1/replicationcontrollers.py index ba66d2d4..5b0f46cd 100644 --- a/magnumclient/v1/replicationcontrollers.py +++ b/magnumclient/v1/replicationcontrollers.py @@ -59,8 +59,8 @@ class ReplicationControllerManager(base.Manager): :param sort_dir: Optional, direction of sorting, either 'asc' (the default) or 'desc'. - :param detail: Optional, boolean whether to return detailed information - about ReplicationControllers. + :param detail: Optional, boolean whether to return detailed + information about ReplicationControllers. :returns: A list of ReplicationControllers. @@ -78,10 +78,10 @@ class ReplicationControllerManager(base.Manager): path += '?' + '&'.join(filters) if limit is None: - return self._list(self._path(bay_ident), "rcs") + return self._list(self._path(bay_ident=bay_ident), "rcs") else: - return self._list_pagination(self._path(bay_ident), "rcs", - limit=limit) + return self._list_pagination(self._path(bay_ident=bay_ident), + "rcs", limit=limit) def get(self, id, bay_ident): try: