From 2bf7bf6a84ec7023b5b5320f518b4728730c8a53 Mon Sep 17 00:00:00 2001 From: Martin Kopec Date: Sun, 29 Aug 2021 17:09:01 +0000 Subject: [PATCH] [Trivial] Fix swift's extension discovery In case the swift's endpoint returned an exception during an extension query, get_capabilities method returned a string of an empty dict, which is always "true" and therefore it confues a later if statement checking if any extensions were found. Let's make the method return an object - dict - which will be either true (if contains any data) or false (if it's empty). Change-Id: Ie7974c97a4b119e41fba7150bcd2a2553300f694 --- config_tempest/services/object_storage.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config_tempest/services/object_storage.py b/config_tempest/services/object_storage.py index 7907c19e..094d3ab9 100644 --- a/config_tempest/services/object_storage.py +++ b/config_tempest/services/object_storage.py @@ -32,7 +32,6 @@ class ObjectStorageService(Service): # (e.g.: when ceph is on swift) capabilities = self.get_capabilities('swift/info') - capabilities = json.loads(capabilities) # Remove Swift general information from extensions list capabilities.pop('swift', {}) self.extensions = capabilities.keys() @@ -48,7 +47,7 @@ class ObjectStorageService(Service): LOG.warning('Object storage %s API endpoint not discovered. ' 'Error message: %s', path, e) - return body + return json.loads(body) def list_create_roles(self, conf, client): try: