From 388bbbac2ce6bf9baf2f9ceb6102b0b1f7072264 Mon Sep 17 00:00:00 2001 From: Steve Martinelli Date: Mon, 6 Oct 2014 03:37:46 -0400 Subject: Fix issues with object related commands 1) Can't create instance of swiftclient. Since we now create an API instance, creating a swiftclient instance won't work. Trying to do any object related command fails. 2) Listing objects in a container fails, we depend on the data returned in a specific way, during the API transition this must have slipped through. Needs regression/funcitonal tests to mame sure this doesn't happen again. Change-Id: I69079a0dc9f32b84e6f9307729d3dbbba549ac5e --- openstackclient/api/object_store_v1.py | 5 +++-- openstackclient/object/client.py | 6 ------ 2 files changed, 3 insertions(+), 8 deletions(-) (limited to 'openstackclient') diff --git a/openstackclient/api/object_store_v1.py b/openstackclient/api/object_store_v1.py index f938b55e..57db9063 100644 --- a/openstackclient/api/object_store_v1.py +++ b/openstackclient/api/object_store_v1.py @@ -252,6 +252,7 @@ class APIv1(api.BaseAPI): if container is None or object is None: return None + params['format'] = 'json' if all_data: data = listing = self.object_list( container=container, @@ -280,7 +281,6 @@ class APIv1(api.BaseAPI): data.extend(listing) return data - params = {} if limit: params['limit'] = limit if marker: @@ -320,7 +320,8 @@ class APIv1(api.BaseAPI): ) if response.status_code == 200: if not os.path.exists(os.path.dirname(file)): - os.makedirs(os.path.dirname(file)) + if len(os.path.dirname(file)) > 0: + os.makedirs(os.path.dirname(file)) with open(file, 'wb') as f: for chunk in response.iter_content(): f.write(chunk) diff --git a/openstackclient/object/client.py b/openstackclient/object/client.py index 887aa85b..1ac905c3 100644 --- a/openstackclient/object/client.py +++ b/openstackclient/object/client.py @@ -33,12 +33,6 @@ API_VERSIONS = { def make_client(instance): """Returns an object-store API client.""" - object_client = utils.get_client_class( - API_NAME, - instance._api_version[API_NAME], - API_VERSIONS) - LOG.debug('Instantiating object client: %s', object_client) - if instance._url: endpoint = instance._url else: -- cgit v1.2.1