diff options
author | Mark J. Washenberger <mark.washenberger@markwash.net> | 2013-08-08 22:31:40 -0700 |
---|---|---|
committer | Mark J. Washenberger <mark.washenberger@markwash.net> | 2013-08-08 22:31:40 -0700 |
commit | eb47b55dbd078aea4eedcc70ad44d189510c6644 (patch) | |
tree | c523af00fa8bfe17abd36cf19dc7488029718b35 | |
parent | 5cdbcdf3fc20c9136739f0dfac2db63d670e2303 (diff) | |
download | python-glanceclient-eb47b55dbd078aea4eedcc70ad44d189510c6644.tar.gz |
Revert 02116565d358a4fa254217779fef82b14b38d8ca0.10.0
A patch slipped in that modified the default image list limit in a
backwards-incompatible way. This change reverts that patch, but
preserves some of the formatting improvements.
Change-Id: I17ae5024896ca7b1064be66b9e47653e953771d6
-rw-r--r-- | glanceclient/v1/images.py | 2 | ||||
-rw-r--r-- | glanceclient/v2/images.py | 2 | ||||
-rw-r--r-- | tests/v1/test_images.py | 25 |
3 files changed, 13 insertions, 16 deletions
diff --git a/glanceclient/v1/images.py b/glanceclient/v1/images.py index fbb406d..8b2ce2a 100644 --- a/glanceclient/v1/images.py +++ b/glanceclient/v1/images.py @@ -31,7 +31,7 @@ UPDATE_PARAMS = ('name', 'disk_format', 'container_format', 'min_disk', CREATE_PARAMS = UPDATE_PARAMS + ('id', 'store') -DEFAULT_PAGE_SIZE = 100 +DEFAULT_PAGE_SIZE = 20 SORT_DIR_VALUES = ('asc', 'desc') SORT_KEY_VALUES = ('name', 'status', 'container_format', 'disk_format', diff --git a/glanceclient/v2/images.py b/glanceclient/v2/images.py index 8cb60e1..7d698d0 100644 --- a/glanceclient/v2/images.py +++ b/glanceclient/v2/images.py @@ -20,7 +20,7 @@ import warlock from glanceclient.common import utils from glanceclient.openstack.common import strutils -DEFAULT_PAGE_SIZE = 100 +DEFAULT_PAGE_SIZE = 20 class Controller(object): diff --git a/tests/v1/test_images.py b/tests/v1/test_images.py index acfbd37..4c5c029 100644 --- a/tests/v1/test_images.py +++ b/tests/v1/test_images.py @@ -51,7 +51,7 @@ fixtures = { ), ), }, - '/v1/images/detail?limit=%d' % images.DEFAULT_PAGE_SIZE: { + '/v1/images/detail?limit=20': { 'GET': ( {}, {'images': [ @@ -158,7 +158,7 @@ fixtures = { ]}, ), }, - '/v1/images/detail?marker=a&limit=%d' % images.DEFAULT_PAGE_SIZE: { + '/v1/images/detail?marker=a&limit=20': { 'GET': ( {}, {'images': [ @@ -228,7 +228,7 @@ fixtures = { ]}, ), }, - '/v1/images/detail?limit=%d&name=foo' % images.DEFAULT_PAGE_SIZE: { + '/v1/images/detail?limit=20&name=foo': { 'GET': ( {}, {'images': [ @@ -245,7 +245,7 @@ fixtures = { ]}, ), }, - '/v1/images/detail?property-ping=pong&limit=%d' % images.DEFAULT_PAGE_SIZE: + '/v1/images/detail?property-ping=pong&limit=20': { 'GET': ( {}, @@ -258,7 +258,7 @@ fixtures = { ]}, ), }, - '/v1/images/detail?sort_dir=desc&limit=%d' % images.DEFAULT_PAGE_SIZE: { + '/v1/images/detail?sort_dir=desc&limit=20': { 'GET': ( {}, {'images': [ @@ -275,7 +275,7 @@ fixtures = { ]}, ), }, - '/v1/images/detail?sort_key=name&limit=%d' % images.DEFAULT_PAGE_SIZE: { + '/v1/images/detail?sort_key=name&limit=20': { 'GET': ( {}, {'images': [ @@ -398,34 +398,31 @@ class ImageManagerTest(testtools.TestCase): def test_list_with_marker(self): list(self.mgr.list(marker='a')) - url = '/v1/images/detail?marker=a&limit=%d' % images.DEFAULT_PAGE_SIZE + url = '/v1/images/detail?marker=a&limit=20' expect = [('GET', url, {}, None)] self.assertEqual(self.api.calls, expect) def test_list_with_filter(self): list(self.mgr.list(filters={'name': "foo"})) - url = '/v1/images/detail?limit=%d&name=foo' % images.DEFAULT_PAGE_SIZE + url = '/v1/images/detail?limit=20&name=foo' expect = [('GET', url, {}, None)] self.assertEqual(self.api.calls, expect) def test_list_with_property_filters(self): list(self.mgr.list(filters={'properties': {'ping': 'pong'}})) - url = '/v1/images/detail?property-ping=pong&limit=%d' % \ - images.DEFAULT_PAGE_SIZE + url = '/v1/images/detail?property-ping=pong&limit=20' expect = [('GET', url, {}, None)] self.assertEqual(self.api.calls, expect) def test_list_with_sort_dir(self): list(self.mgr.list(sort_dir='desc')) - url = '/v1/images/detail?sort_dir=desc&limit=%d' % \ - images.DEFAULT_PAGE_SIZE + url = '/v1/images/detail?sort_dir=desc&limit=20' expect = [('GET', url, {}, None)] self.assertEqual(self.api.calls, expect) def test_list_with_sort_key(self): list(self.mgr.list(sort_key='name')) - url = '/v1/images/detail?sort_key=name&limit=%d' % \ - images.DEFAULT_PAGE_SIZE + url = '/v1/images/detail?sort_key=name&limit=20' expect = [('GET', url, {}, None)] self.assertEqual(self.api.calls, expect) |