Merge "Stop reinventing the is_public filter for Glance v1"

This commit is contained in:
Jenkins 2017-08-29 10:06:01 +00:00 committed by Gerrit Code Review
commit 9dc5d9a554
2 changed files with 4 additions and 4 deletions

View File

@ -107,9 +107,8 @@ class GlanceV1Service(service.Service, glance_common.GlanceMixin):
:param owner: Filter in images for tenant ID :param owner: Filter in images for tenant ID
""" """
images = self._clients.glance("1").images.list(status=status, images = self._clients.glance("1").images.list(status=status,
owner=owner) owner=owner,
if is_public in [True, False]: is_public=is_public)
return [i for i in images if i.is_public is is_public]
return images return images
@atomic.action_timer("glance_v1.set_visibility") @atomic.action_timer("glance_v1.set_visibility")

View File

@ -117,7 +117,8 @@ class GlanceV1ServiceTestCase(test.TestCase):
self.service.list_images(is_public=is_public, status=status, self.service.list_images(is_public=is_public, status=status,
owner=owner) owner=owner)
self.gc.images.list.assert_called_once_with(status=status, self.gc.images.list.assert_called_once_with(status=status,
owner=owner) owner=owner,
is_public=is_public)
def test_set_visibility(self): def test_set_visibility(self):
image_id = "image_id" image_id = "image_id"