diff options
author | Zuul <zuul@review.opendev.org> | 2020-05-08 08:41:58 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2020-05-08 08:41:58 +0000 |
commit | 0f03d535f4b949a314db2894c0bb32eaa724c3a9 (patch) | |
tree | d3e08f74e3b2bb05695a0e13be5f3d253368f5a0 /glance_store/_drivers | |
parent | 7f654832c32c9c6b4f84b2bb2c39622214ca53db (diff) | |
parent | 98b9091129e78d03dc5b97bd1503063499f166d5 (diff) | |
download | glance_store-0f03d535f4b949a314db2894c0bb32eaa724c3a9.tar.gz |
Merge "Fix: API returns 503 if one of the store is mis-configured"
Diffstat (limited to 'glance_store/_drivers')
-rw-r--r-- | glance_store/_drivers/rbd.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/glance_store/_drivers/rbd.py b/glance_store/_drivers/rbd.py index 0e3e487..09dc941 100644 --- a/glance_store/_drivers/rbd.py +++ b/glance_store/_drivers/rbd.py @@ -271,10 +271,16 @@ class Store(driver.Store): try: client.connect(timeout=self.connect_timeout) - except rados.Error: - msg = _LE("Error connecting to ceph cluster.") - LOG.exception(msg) - raise exceptions.BackendException() + except (rados.Error, rados.ObjectNotFound) as e: + if self.backend_group and len(self.conf.enabled_backends) > 1: + reason = _("Error in store configuration: %s") % e + LOG.debug(reason) + raise exceptions.BadStoreConfiguration( + store_name=self.backend_group, reason=reason) + else: + msg = _LE("Error connecting to ceph cluster.") + LOG.exception(msg) + raise exceptions.BackendException() try: yield client finally: |