diff --git a/zunclient/common/base.py b/zunclient/common/base.py index 042628f3..c62060c2 100644 --- a/zunclient/common/base.py +++ b/zunclient/common/base.py @@ -144,8 +144,8 @@ class Manager(object): url = "%s?%s" % (url, urlparse.urlencode(qparams)) self.api.raw_request('DELETE', url) - def _search(self, url, body=None, response_key=None, obj_class=None, - qparams=None): + def _search(self, url, qparams=None, response_key=None, obj_class=None, + body=None): if qparams: url = "%s?%s" % (url, urlparse.urlencode(qparams)) diff --git a/zunclient/tests/unit/v1/test_images.py b/zunclient/tests/unit/v1/test_images.py index 554f0e63..286c7f15 100644 --- a/zunclient/tests/unit/v1/test_images.py +++ b/zunclient/tests/unit/v1/test_images.py @@ -91,7 +91,8 @@ fake_responses = { {'images': [IMAGE2, IMAGE1]}, ), }, - '/v1/images/%s/search' % IMAGE3['image']: + '/v1/images/%s/search?image_driver=%s' % (IMAGE3['image'], + IMAGE3['image_driver']): { 'GET': ( {}, @@ -182,9 +183,10 @@ class ImageManagerTest(testtools.TestCase): def test_image_search(self): images = self.mgr.search_image(**SEARCH_IMAGE) + url = '/v1/images/%s/search?image_driver=%s' \ + % (IMAGE3['image'], IMAGE3['image_driver']) expect = [ - ('GET', '/v1/images/%s/search' % IMAGE3['image'], {}, - {'image_driver': IMAGE3['image_driver']}), + ('GET', url, {}, None), ] self.assertEqual(expect, self.api.calls) self.assertThat(images, matchers.HasLength(1))