summaryrefslogtreecommitdiff
path: root/openstackclient/api/image_v2.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-01-28 05:43:09 +0000
committerGerrit Code Review <review@openstack.org>2015-01-28 05:43:09 +0000
commita4394ebb7ad42832d5c2e53c96b616c5fc357378 (patch)
tree5c368bb985ef6d94044d49803fe5b3689be4e07e /openstackclient/api/image_v2.py
parentc3aad41341ac2d5f22fa85655c42ea3a4adedd06 (diff)
parent61a40343fdbb89a1c6404ab03fcfd84daee31c9e (diff)
downloadpython-openstackclient-a4394ebb7ad42832d5c2e53c96b616c5fc357378.tar.gz
Merge "Add filter to image list"
Diffstat (limited to 'openstackclient/api/image_v2.py')
-rw-r--r--openstackclient/api/image_v2.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/openstackclient/api/image_v2.py b/openstackclient/api/image_v2.py
index c5c78431..37c2ed83 100644
--- a/openstackclient/api/image_v2.py
+++ b/openstackclient/api/image_v2.py
@@ -30,6 +30,7 @@ class APIv2(image_v1.APIv1):
detailed=False,
public=False,
private=False,
+ shared=False,
**filter
):
"""Get available images
@@ -49,17 +50,17 @@ class APIv2(image_v1.APIv1):
both public and private images which is the same set as all images.
http://docs.openstack.org/api/openstack-image-service/2.0/content/list-images.html
-
- TODO(dtroyer): Implement filtering
"""
- if public == private:
- # No filtering for both False and both True cases
+ if not public and not private and not shared:
+ # No filtering for all False
filter.pop('visibility', None)
elif public:
filter['visibility'] = 'public'
elif private:
filter['visibility'] = 'private'
+ elif shared:
+ filter['visibility'] = 'shared'
url = "/images"
if detailed: