Commit Graph

22 Commits

Author SHA1 Message Date
Sean McGinnis db7377f476 Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: I380f25044c8f7b496d485aabf09215468f955818
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-23 10:29:22 +00:00
Joe Keen 1d680f1739 Make default notifiers pluggable
Erasing distinction between plugins that are an inherent part of the
notification engine and plugins that can be specified via the config file.
Fixing broken tests.

Story: 2003801
Task: 26532
Change-Id: I360cc2ad0782f209606706bf1869570fdae2260d
2019-01-17 11:58:45 +01:00
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
Vu Cong Tuan 8b6260e10f Use assertRegex instead of assertRegexpMatches
In Python3, assertRegexpMatches & assertNotRegexpMatches
are deprecated in favor of assertRegex and assertNotRegex

Change-Id: I52b84fd49bed43902f0a57983710c0fb08649b12
2017-11-07 14:52:35 +07: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 722ecaa7a5 Add config option for statsd
Add new section to config file with configuration for statsd
host and port. Add modification in notification engines.
According to the monasca-agent change:
https://review.openstack.org/#/c/381417

Change-Id: I6e99bae5e50f3670ae8b4a0c7ac5af3c747bcd68
2016-12-02 07:10:52 +01: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 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
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
Joe Keen 9f0e65028f Added retry engine to notification system
Change-Id: Iea1a05c1b7336b9e3e8aeb972e0f9ba1b7f74d69
2015-02-09 11:40:02 -07:00
Joe Keen 3eb169fac3 Notification engine refactored from many processes to one
Squished the notification down to one process in preparation for making
multiple engine instances able to talk to the same topic.

Added HA capabilities to the KafkaConsumer object.

Change-Id: Id4799d690c7caf10ae7ba89c2d4e0aeb76c54375
2015-01-30 11:59:57 -07:00
Joe Keen ebc1ed72d6 Refactored notification engine types
Added more test coverage for email notifications.

Moved notification methods from notification_processor to new types directory.

types/interface.py now automatically records statsd information for configured
types.

Configuration for a type is now optional.  Uncofigured types are not able to
send notifications.  Notifications that come across for unconfigured types
generate a warning.

Email notification type now explicity exits when unable to connect to an SMTP
server.

Change-Id: I213d815965761736eb3680b5e14206ba7bef7e90
2015-01-21 10:07:00 -07:00
Joe Keen 45a2411ebb Added pagerduty support to notification_processor
Refactored the tests to make pagerduty functionality more clear

Change-Id: Ie9616d8629112fc5f1f1576951a3cbe3b99218b0
2015-01-05 17:20:55 -07:00
Joe Keen 70f24b2034 Webhook now passes alarm_id instead of alarm_name
Change-Id: I3b7606e9584066edcbeb99cb3fe0ff308114b436
2014-12-16 15:17:36 -07:00
Joe Keen f0b4f91960 Added timeout to webhook
Added a timeout keyword to requests.post that we use to send webhooks.  Updated
the tests to verify that the webhook will properly time out.

Change-Id: I27140a8c13afcd8f2e30ea1367f0bd9f4944ba36
2014-12-12 15:42:03 -07:00
Joe Keen a2271ba7c8 Added test coverage for email and webhook notification
Fixed expression in exception trap

Change-Id: I2e545153aae114b9d0fa86f7202a8cac35e3120d
2014-12-10 10:20:19 -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
Roland Hochmuth 78d7ce32d5 Added copyright header, LICENSE and HACKING.rst. 2014-05-01 12:27:06 -06:00
Tim Kuhlman a77fd0406d Added first notification processor test 2014-03-21 17:13:06 -06:00