Commit fa984c2c authored by Stavros Sachtouris's avatar Stavros Sachtouris
Browse files

mage-public: remove params without values

parent c3d131ec
......@@ -93,8 +93,7 @@ class image_public(_init_image):
def main(self):
super(self.__class__, self).main()
filters = {}
for arg in set(
[
for arg in set([
'container_format',
'disk_format',
'name',
......
......@@ -54,8 +54,11 @@ class ImageClient(Client):
"""
path = path4url('images', 'detail') if detail else path4url('images/')
async_params = {}
if isinstance(filters, dict):
self.http_client.params.update(filters)
for key, value in filters.items():
if value:
async_params[key] = value
if order.startswith('-'):
self.set_param('sort_dir', 'desc')
order = order[1:]
......@@ -63,7 +66,7 @@ class ImageClient(Client):
self.set_param('sort_dir', 'asc')
self.set_param('sort_key', order, iff=order)
r = self.get(path, success=200)
r = self.get(path, async_params=async_params, success=200)
return r.json
def get_meta(self, image_id):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment