Commit Graph

13 Commits

Author SHA1 Message Date
Jui Chandwaskar d396753a83 Update pep8 checks
* Set max line length to 100
* Clean up code for pep8 checks

Change-Id: Ie00dc204f522fb2112f02f4151ec8a15d5523459
Signed-off-by: Jui Chandwaskar <jchandwaskar@op5.com>
2018-04-11 14:16:27 +02:00
Tomasz Trębski e1a9b9a96a Integrate with oslo.conf and oslo.log
Change upgrades the monasca-notification to leverage
the capabilities of both oslo.log and oslo.conf:

- configuration of logging separated from application settings
- ability to enforce data types for application settings
- ability to use oslo.config-generator capabilities
- automatic configuration parsing done by oslo.cfg

That change will bring it closer to the rest of monasca
components where such transition has happened already.
However, in the rest of monasca, oslo.cfg was partially
or fully implemented whereas monasca-notification has
been relying on YAML based configuration file.

Therefore backward compatybility for such format will
be kept for now.

Story: 2000959
Task: 4093
Task: 4092

Change-Id: Ia75c3b60d0fada854178f21ca5ccb9e6a880f37f
2017-10-20 09:32:11 +02:00
Artur Basiak 1ee321bb05 Make code compatible with Python3.5
Add adjustments:
   - read configuration file in binary mode
   - remove extra encoding
   - check if string is binary class and convert it to
     standard string

Change-Id: I5f73b6b0e8b5592539e07fe66debf917540ce24c
Story: 2001124
Task: 4816
2017-08-10 07:12:26 +02:00
Tomasz Trębski c9f0a8e63c Enable Py35 tests to run
Python3.5 tests were not running because Python3 has not
Queue module (instead have queue module). Commit
does not fix failing tests but gives an insight in what
exactly is failing and allows to fix them in future.

Also applied sixer utility to fix common Py2-Py3 compatybility
issues.

Additionally:
* removed unconstrained mysql and psycopg drivers from tox.ini.
  Instead added them to test-requirements to be picked up
  by requirements bot. That also allowed to remove 3 tox
  environments.
* added removing .testrepository/times.dbm (may cause py3 environment
  to fail if present)

Change-Id: I9bcc33dad80fdfbf60d95c4bb0ce7f79f642a414
2017-04-07 19:15:10 +00:00
Cao Xuan Hoang 69f4c2b8e3 Clean imports in code
This patch set modifies lines which are importing objects
instead of modules. As per openstack import guide lines, user should
import modules in a file not objects.

http://docs.openstack.org/developer/hacking/#imports

Change-Id: I3c5c7368fb006f3691d07cef9557c20a42cc5b76
2016-10-06 15:27:06 +07:00
Michael James Hoppal 063c4f1d1d Query database to see if the periodic notificiation changes
Also added notification id to notification object we construct in the
alarm processor

Change-Id: I6ccfffc9102bec8f670df13268e244cb0c998950
2016-08-29 15:11:20 -06:00
haali1 9ee7f5c6fe Fix race condition in notification type inserts
We are inserting notification type plugin names on monasca_notification
start up. If another instance of monasca_notification services is started
at the same time in another controller, then this will occur.

Change-Id: Id7401bbcbdc9d6942baa49e3b335a12fe4366acf
2016-08-09 18:57:34 -07:00
haali1 be6fb21e19 Add HipChat and Slack Notification types
This patch
   1. Supports for loading new notification types as plugins.
   2) Adds new plugins for HipChat and Slack
   3) Insert Notification types during startup

Partially-implements: blueprint notification-engine-plugin
Change-Id: I246ced3fe22a9797a3c8384f7bda166797cfac3a
2016-07-29 07:59:32 -07:00
Michael James Hoppal 79189ca811 Adding support for periodic notifications
New periodic notification engine that will take a notification send it, and then
place it back onto the periodic notification topic. Once the alarm associated
with the notification has transitioned to a state that is different from the
original state the notification is removed from the queue.

Change-Id: Ie3103a0ec30abcd8dfc53869b1c3135953aabf3a
2016-05-09 08:18:11 -06:00
bklei f333f92709 Support dynamic mysql port via config file
This is necessary in some installations to specify a non-default
mysql port (something other than 3306).  All of the other monasca
packages allow overriding this in the config file, this change
brings monasca-notification inline with the others.

Change-Id: Ibe6ffca9e5adb13e44594531358e2a8e5da46b9d
2016-03-02 09:06:24 -07:00
Michal Zielonka 94f5bdbd62 Migrate from MysqlDB to pymysql
Change-Id: I61b7a35badaa4a3480a1c786152b07c17a99bf80
2015-12-16 09:51:28 +01:00
Joe Keen 82ae201cc4 Fixed mysql reconnect on error
Change-Id: I4bb502b295ee9f5d748bb11eadeae7392235981c
2015-08-21 14:37:53 -06:00
Michal Zielonka a82a49a1e8 Add configurable database setting (mysql, postgres, orm)
We used sqlalchemy.core for execute query for orm.
The configuration of db is based on monasca-api.
The default mode is mysql connection so we can use old configuration.

Change-Id: Iebb4d6dfca6d43298ced407178e7f9673a83a7ca
2015-08-04 22:34:57 +02:00