diff --git a/monasca_notification/processors/alarm_processor.py b/monasca_notification/processors/alarm_processor.py index d51c4e6..413c336 100644 --- a/monasca_notification/processors/alarm_processor.py +++ b/monasca_notification/processors/alarm_processor.py @@ -37,7 +37,8 @@ class AlarmProcessor(BaseProcessor): try: self._mysql = MySQLdb.connect(host=mysql_host, user=mysql_user, passwd=unicode(mysql_passwd).encode('utf-8'), - db=dbname, ssl=mysql_ssl) + db=dbname, ssl=mysql_ssl, + use_unicode=True, charset="utf8") self._mysql.autocommit(True) except: log.exception('MySQL connect failed') diff --git a/monasca_notification/retry_engine.py b/monasca_notification/retry_engine.py index d5e5f01..ac07ea2 100644 --- a/monasca_notification/retry_engine.py +++ b/monasca_notification/retry_engine.py @@ -84,15 +84,15 @@ class RetryEngine(object): notification.retry_count += 1 notification.notification_timestamp = time.time() if notification.retry_count < self._retry_max: - log.error("retry failed for {} with name {} " - "at {}. " - "Saving for later retry.".format(ntype, name, addr)) + log.error(u"retry failed for {} with name {} " + u"at {}. " + u"Saving for later retry.".format(ntype, name, addr)) self._producer.publish(self._topics['retry_topic'], [notification]) else: - log.error("retry failed for {} with name {} " - "at {} after {} retries. " - "Giving up on retry." + log.error(u"retry failed for {} with name {} " + u"at {} after {} retries. " + u"Giving up on retry." .format(ntype, name, addr, self._retry_max)) self._consumer.commit([partition]) diff --git a/monasca_notification/types/webhook_notifier.py b/monasca_notification/types/webhook_notifier.py index e32842b..452b446 100644 --- a/monasca_notification/types/webhook_notifier.py +++ b/monasca_notification/types/webhook_notifier.py @@ -40,11 +40,6 @@ class WebhookNotifier(AbstractNotifier): Posts on the given url """ - self._log.info("Notifying alarm {} to {} with action {}" - .format(notification.alarm_name, - notification.state, - notification.address)) - body = {'alarm_id': notification.alarm_id, 'alarm_definition_id': notification.raw_alarm['alarmDefinitionId'], 'alarm_name': notification.alarm_name,