From 6da299f3455cd090acabd02199b78b541e9a1030 Mon Sep 17 00:00:00 2001 From: Mike Fedosin Date: Wed, 10 Jan 2018 17:23:21 +0100 Subject: [PATCH] Adopt new api for artifact listing In change Ic0762f7a379754d19147a4f41a6d5a98abdc86b0 we renamed section to unified 'artifacts'. We need to reflect this changes in the client, otherwise it doesn't work. Change-Id: I10e5b5678180586d6f09b8dd4d83fb3f45e1f569 --- glareclient/v1/artifacts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glareclient/v1/artifacts.py b/glareclient/v1/artifacts.py index 59c4c02..a73f176 100644 --- a/glareclient/v1/artifacts.py +++ b/glareclient/v1/artifacts.py @@ -118,7 +118,7 @@ class Controller(object): type_name = self._check_type_name(type_name) url = '/artifacts/%s?version=%s&name=%s' % (type_name, version, name) resp, body = self.http_client.get(url) - arts = body[type_name] + arts = body.get('artifacts', body.get(type_name)) if not arts: msg = ('Artifact with name=%s and version=%s not found.' % (name, version)) @@ -138,7 +138,7 @@ class Controller(object): ' Please provide the concrete id from the list:\n%s' % (name, version, output)) raise exc.BadRequest(msg) - return body[type_name][0] + return arts[0] def list(self, type_name=None, **kwargs): """Retrieve a listing of artifacts objects.