diff options
Diffstat (limited to 'openstackclient/object/v1/lib/object.py')
-rw-r--r-- | openstackclient/object/v1/lib/object.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/openstackclient/object/v1/lib/object.py b/openstackclient/object/v1/lib/object.py index 8ad5e5a5..6f9c9d63 100644 --- a/openstackclient/object/v1/lib/object.py +++ b/openstackclient/object/v1/lib/object.py @@ -86,22 +86,23 @@ def list_objects( return data object_url = url - query = "format=json" + params = { + 'format': 'json', + } if marker: - query += '&marker=%s' % marker + params['marker'] = marker if limit: - query += '&limit=%d' % limit + params['limit'] = limit if end_marker: - query += '&end_marker=%s' % end_marker + params['end_marker'] = end_marker if delimiter: - query += '&delimiter=%s' % delimiter + params['delimiter'] = delimiter if prefix: - query += '&prefix=%s' % prefix + params['prefix'] = prefix if path: - query += '&path=%s' % path - url = "%s/%s?%s" % (object_url, container, query) - response = api.request('GET', url) - return response.json() + params['path'] = path + url = "%s/%s" % (object_url, container) + return api.list(url, params=params) def show_object( @@ -118,9 +119,8 @@ def show_object( :returns: dict of object properties """ - object_url = "%s/%s/%s" % (url, container, obj) + response = api.head("%s/%s/%s" % (url, container, obj)) url_parts = urlparse(url) - response = api.request('HEAD', object_url) data = { 'account': url_parts.path.split('/')[-1], 'container': container, |