From 6c90b469c0274d365b5f6caeb88b536e2a835991 Mon Sep 17 00:00:00 2001 From: fengchaoyang Date: Wed, 30 Nov 2016 10:56:17 +0800 Subject: [PATCH] Change gnocchi_ext.NotFound to gnocchi_ext.ResourceTypeNotFound Makes the exception locator more specific. Change-Id: Ia2fd73666f9da9ac132f7408996defe92a677cc0 --- ceilometer/gnocchi_client.py | 4 +--- setup.cfg | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ceilometer/gnocchi_client.py b/ceilometer/gnocchi_client.py index 1e3deabe..13c459c8 100644 --- a/ceilometer/gnocchi_client.py +++ b/ceilometer/gnocchi_client.py @@ -105,9 +105,7 @@ def upgrade_resource_types(conf): for name, attributes in resources_initial.items(): try: gnocchi.resource_type.get(name=name) - except gnocchi_exc.NotFound: - # FIXME(sileht): It should be ResourceTypeNotFound but - # gnocchiclient doesn't raise that :( + except gnocchi_exc.ResourceTypeNotFound: rt = {'name': name, 'attributes': attributes} try: gnocchi.resource_type.create(resource_type=rt) diff --git a/setup.cfg b/setup.cfg index 7688d2d1..a43d1141 100644 --- a/setup.cfg +++ b/setup.cfg @@ -33,7 +33,7 @@ data_files = [extras] gnocchi = - gnocchiclient>=2.2.0 # Apache-2.0 + gnocchiclient>=2.7.0 # Apache-2.0 mongo = pymongo!=3.1,>=3.0.2 # Apache-2.0 postgresql =