From abbe182cf156d381a5ab976b8e298c5cd4686657 Mon Sep 17 00:00:00 2001 From: Sumit Jamgade Date: Fri, 22 Feb 2019 13:58:08 +0100 Subject: [PATCH] make ceilometer client import optional on ImportError set HAS_CEILCLIENT to false Without this none of the watcher componenets can be started for master as well as rocky because the ceilometercleint was deprecated. Using the variable the support for ceilometer can be gradually removed from master A backport to rocky will allow using watcher without ceilometerclient. Change-Id: I3beb0fb8f0a8e8e0a22acaf6bdeca492836bbee2 --- watcher/common/clients.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/watcher/common/clients.py b/watcher/common/clients.py index 80c2f57c9..fc504a6c5 100755 --- a/watcher/common/clients.py +++ b/watcher/common/clients.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from ceilometerclient import client as ceclient + from cinderclient import client as ciclient from glanceclient import client as glclient from gnocchiclient import client as gnclient @@ -25,6 +25,12 @@ from watcher.common import exception from watcher import conf +try: + from ceilometerclient import client as ceclient + HAS_CEILCLIENT = True +except ImportError: + HAS_CEILCLIENT = False + CONF = conf.CONF _CLIENTS_AUTH_GROUP = 'watcher_clients_auth'