Browse Source

[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
changes/00/806500/1
Martin Kopec 9 months ago
parent
commit
2bf7bf6a84
  1. 3
      config_tempest/services/object_storage.py

3
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:

Loading…
Cancel
Save