+
+
+class SmoNotifications(AbstractNotifications):
+ def __init__(self):
+ logger.debug('In SmoNotifications')
+ if conf.PUBSUB.SMO_AUTH_URL is not None \
+ and conf.PUBSUB.SMO_AUTH_URL != '':
+ logger.debug(f'SMO_AUTH_URL is {conf.PUBSUB.SMO_AUTH_URL}')
+ self.smo_client = SMOClient(
+ conf.PUBSUB.SMO_CLIENT_ID, conf.PUBSUB.SMO_AUTH_URL,
+ conf.PUBSUB.SMO_USERNAME, conf.PUBSUB.SMO_PASSWORD,
+ use_oauth=True)
+ else:
+ self.smo_client = SMOClient()
+
+ def send(self, url, message):
+ try:
+ return self.smo_client.post(url, message)
+ except Exception as e:
+ logger.critical('Notify except: {}'.format(e))
+ return False