From 209a1a55adeefb53316e7196dc6fedb00fb49d09 Mon Sep 17 00:00:00 2001 From: Pradeep Kilambi Date: Fri, 29 Jan 2016 12:12:54 -0500 Subject: [PATCH] Load zaqar client outside init Closes-bug: #1539685 Change-Id: Iad50452e750262dfb774361410507c5dcf8bbea0 --- aodh/notifier/zaqar.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/aodh/notifier/zaqar.py b/aodh/notifier/zaqar.py index 2b33d4c8e..59078878b 100644 --- a/aodh/notifier/zaqar.py +++ b/aodh/notifier/zaqar.py @@ -41,7 +41,7 @@ class ZaqarAlarmNotifier(notifier.AlarmNotifier): def __init__(self, conf): super(ZaqarAlarmNotifier, self).__init__(conf) self.conf = conf - self.client = self.get_zaqar_client() + self._zclient = None def _get_endpoint(self): try: @@ -95,6 +95,12 @@ class ZaqarAlarmNotifier(notifier.AlarmNotifier): message = dict(body=body) self.notify_zaqar(action, message) + @property + def client(self): + if self._zclient is None: + self._zclient = self.get_zaqar_client() + return self._zclient + def notify_zaqar(self, action, message): queue_info = urlparse.parse_qs(action.query)