Commit Graph

14 Commits

Author SHA1 Message Date
Doug Szumski efc6e28edc Fix periodic notifications for webhooks
- Removes the hard-coded magic number of 60 seconds allowing users to
  choose the period that they require.
- Standardise on strings for DictOpt dict keys. When loaded from a config
  file, the DictOpt keys are parsed as strings, which was conflicting with
  the default integer dict keys. This caused the periodic engine to silently
  fail to load when configured via a config file.
- Remove unused variable

Story: 2006783
Task: 37313
Change-Id: Ibd61c45fc1ade37022150d34a5b00c56fdf69814
2019-12-11 11:13:17 +00:00
Nguyen Hai Truong c9ef9d9d02 trivial fix: Correct some spelling errors
Small modification to correct spelling mistake.

Change-Id: Ic7f145291dc5829cf6955b8714c87dba96e04bde
2018-11-08 01:08:05 -08:00
Tomasz Trębski fe78b6d698 Make monasca-notification Py35 compatible
Adjust the monasca-notification to run
under Python3.5

Story: 2000975
Task: 4130

Change-Id: I3bf2725fb2904374d7bae51ebf061a47dcbef0c0
2017-07-18 13:31:41 +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
gecong1973 b8ca03dc97 Add __ne__ built-in function
In Python 3 __ne__ by default delegates to __eq__ and inverts the
result, but in Python 2 they urge you to define __ne__ when you
define __eq__ for it to work properly [1].There are no implied
relationships among the comparison operators. The truth of x==y
does not imply that x!=y is false. Accordingly, when defining __eq__(),
one should also define __ne__() so that the operators will behave as
expected.
[1]https://docs.python.org/2/reference/datamodel.html#object.__ne__

Change-Id: I966baba62d906f7521c4e31e37c87ccd5dd3054c
2016-10-17 08:56:55 +08: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
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
Ryan Brandt 97a401027a Change email notification format
Add severity to the subject line
Add up to 10 unique dimension sets in body
Add link and lifecycle state to email body

Change-Id: I85e2e9f2382c6ebadde072967e098e8109f65bfe
2016-01-29 16:42:56 -07:00
Michael James Hoppal 8f05261e6a Add in HP Copyrights
Change-Id: I54d8bb19e6cd44557cf4757bb1283c8b9821ba35
2016-01-27 12:56:23 -07:00
Ryan Brandt 36b37c2120 Add unicode support to email notifications
Change-Id: I82a869a57781c19a041a5ca4a71d35e83daaf18d
2015-04-30 09:34:00 -06:00
Craig Bryant c4b469c11d AlarmStateTransitionedEvent timestamp now in ms
This will ensure a unique timestamp. Influx V9 will only keep one
entry with the same timestamp

Some of the tests weren't using a numerica timestamp which caused
problems when the code tried to divide the timestamp by 1000

Change-Id: Ie0fefc61abe9a95503fa7611971a21ed2cb56224
2015-04-16 13:31:40 -06:00
Joe Keen 9f0e65028f Added retry engine to notification system
Change-Id: Iea1a05c1b7336b9e3e8aeb972e0f9ba1b7f74d69
2015-02-09 11:40:02 -07:00
Steven Travis ebc3c7fc89 Updated email notification
Change-Id: I7e8482b8c1f908ebe505a2f85eeca8397a12b9bf
2014-11-23 12:44:33 -07:00
Tim Kuhlman e6e54c6576 Rename to monasca, setup for tox, removed legacy bits
Removed manual tests which are no longer valid with a modern mini-mon
Removed debian creation bits all distribution is with pypi now
Minor pep8 fixes

Change-Id: I1f2fc4d0ad6375f4c39446f9627247945066e4ad
2014-07-16 15:59:00 -06:00