Commit Graph

15 Commits

Author SHA1 Message Date
Martin Chacon Piza 35a9b57f91 Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Fix problems found by updated hacking version.

Remove hacking and friends from lower-constraints, they are not needed
there at all.

Align lower-constraints for new pip [1]

Fix flake8 E305 and E117 and set W504 as ignored

[1] http://lists.openstack.org/pipermail/openstack-discuss/2020-December/019285.html

Change-Id: Idae87291f4556eee77d40ab49f0d151435d70875
2021-02-23 17:20:15 +01:00
wangzihao 3b91b33784 Remove six
Remove all six usage.

Change-Id: Ib2f0f6cf3b7f5d9ec20440fb81b09c1c083c67b0
Story: 2008305
Task: 41295
2020-11-20 09:35:23 +00:00
Witek Bedyk db01fe425b Migrate from ujson to simplejson
Additionally, temporarily set build-monasca-docker-image as non-voting
due to problems with buggy confluent-kafka 1.4.0 release, which prevents
building the Docker image.

Change-Id: I561ea633a09eb3d7468d2d55aa46d6fb3b2380ff
Story: 2007549
Task: 39390
2020-04-18 10:42:39 +02:00
Doug Szumski 77328b74f4 Add Python Jira module to requirements
The Jira module is now available in global-requirements:
https://review.openstack.org/#/c/562151/

Since the Jira module is now loaded by default, it always
needs to be installed. If a future change prevents loading
of the Jira module unless the Jira plugin is enabled then
this change can be reverted.

Change-Id: I3fea82e681cd49aab5cd6afc29c60302af7b63b7
Story: 2005400
Task: 30394
2019-04-12 11:33:13 +01:00
Charana Nandasena 00cc2527e3 Includes missing configuration options
Includes missing configuration options for notifiers
in generated config file.

Change-Id: I06e6d51bca3b180768bc8c71ff10c9f6e69c5e8b
Story: #2003793
Task: #26506
2019-01-25 11:54:54 +01:00
melissaml 700f5223a9 Remove the duplicated word
Change-Id: Ie6b95d0853d48712e6699aa74da6ae948e72c5a6
2018-08-22 12:40:15 +08: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
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
Haruki Yamanashi 68a6a8319b Send notification to Jira in custom description
This change makes possible to send notification to Jira
in custom description (e.g. AlarmID)

Change-Id: Ib7f9a438a27f29b17967c31922391d76f8f0092f
2017-07-26 14:24:21 +09:00
Haruki Yamanashi 0b82639af0 Fix typo and add configuration example for Jira
Change-Id: Ic304bfff6258126a439dee58b722c773bcfa8c57
2017-07-26 09:23:58 +09: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
Nam Nguyen Hoai 6f75509f9c Replace yaml.load() with yaml.safe_load()
Avoid dangerous file parsing and object serialization libraries.
yaml.load is the obvious function to use but it is dangerous[1]
Because yaml.load return Python object may be dangerous if you
receive a YAML document from an untrusted source such as the Internet.
The function yaml.safe_load limits this ability to simple Python
objects like integers or lists.

In addition, Bandit flags yaml.load() as security risk so replace
all occurrences with yaml.safe_load(). Thus I replace yaml.load()
with yaml.safe_load()

[1] https://security.openstack.org/guidelines/dg_avoid-dangerous-input-parsing-libraries.html

Change-Id: I3f1a756e80b617ba1bcf824ef4dee9a27eb6887a
Closes-Bug: #1634265
2017-01-18 09:31:10 +07:00
gengchc2 6ad7625ae2 Correct reraising of exception
When an exception was caught and rethrown, it should
call 'raise' without any arguments because it shows
the place where an exception occured initially instead
of place where the exception re-raised

Change-Id: I3667715dc1bb4d8d56ad7a8c660c61fa676cdf9f
2016-12-02 10:25:24 +08:00
Haneef Ali 970f01f618 Add Jira Plugin
Depends-On: I246ced3fe22a9797a3c8384f7bda166797cfac3a
Change-Id: I2dc5e2a03a2a8e2e643ea8dd318f4426324d4396
2016-09-23 11:06:56 -07:00