Commit Graph

26 Commits

Author SHA1 Message Date
Ghanshyam Mann 4c8bee08ca Fix hacking min version to 3.0.1
flake8 new release 3.8.0 added new checks and gate pep8
job start failing. hacking 3.0.1 fix the pinning of flake8 to
avoid bringing in a new version with new checks.

Though it is fixed in latest hacking but 2.0 and 3.0 has cap for
flake8 as <4.0.0 which mean flake8 new version 3.9.0 can also
break the pep8 job if new check are added.

To avoid similar gate break in future, we need to bump the hacking min
version.

- http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014828.html

Change-Id: I75bfe1596031c441e0daf7f62a8d81aab279ec9f
2020-05-12 19:29:40 -05:00
Sean McGinnis 1d4e926076
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: I1dca4b2c7eccf1b19482dde60b88a132935b48b8
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-18 11:54:36 -05:00
Andreas Jaeger cedadccc6f Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Fix problems found.

Update local hacking checks for new flake8.

Change-Id: I6396403d0a62f5403fc5b7fb04b6ce790c332c84
2020-03-31 06:49:33 +00:00
Guang Yee e1d73c4b5d add X.509 certificate check plugin
Currently we don't have any capability to monitor the internal TLS/SSL
certificates. i.e. SSL certificates used by MySQL for replication, RabbitMQ for
distribution, etc. The cert_check plugin is not adequate for this purpose
becaue it can only check on certficates over HTTPS endpoints. Furthermore,
checking on these internal certificates over the network is cumbersome
because the agent plugin would have to speak specific protocols.

This patch adds a cert_file_check plugin to detect the certificate expiry
(in days from now) for the given X.509 certificate file in PEM format.
Similar to cert_check plugin, this plugin will a metric
'cert_file.cert_expire_days' which contains the number of days from now the
given certificate will be expired. If the certificate has already expired,
this will be a negative number.

Change-Id: Id95cc7115823f972e234417223ab5906b57447cc
Story: 2006753
2019-11-13 08:35:54 -08:00
akhiljain23 3404a6df72 Update hacking version to 1.1.x
This commit updates hacking version in test-requirements
and fixes some related pep8 issues

Also ignores false positive bandit test
B105: hardcoded_password_string,
B106: hardcoded_password_funcarg
based on variable or argument names.
For more info refer [1][2]

[1] https://bandit.readthedocs.io/en/latest/plugins/b105_hardcoded_password_string.html
[2] https://bandit.readthedocs.io/en/latest/plugins/b106_hardcoded_password_funcarg.html

Change-Id: If779ebad11926594961577e0744093a8ba691610
Story: 2004930
Task: 29314
2019-06-26 12:49:13 +05:30
Witek Bedyk 40b678b5fb Blacklist bandit 1.6.0
Change-Id: Ib2c68d27b372c16038151bd3b77d233420975618
Story: 2005676
Task: 30989
2019-05-14 18:13:54 +02:00
Chuck Short 3add6ce9c6 Switch to using stestr
According to Openstack summit session [1] stestr is maintained
project to which all Openstack projects should migrate.
Let's switch it then.

[1] https://etherpad.openstack.org/p/YVR-python-pti

Change-Id: Ifb460199c94d748988d4f0e836e90d1dd6f294bc
Signed-off-by: Chuck Short <chucks@redhat.com>
2018-08-13 11:19:12 -04:00
Witold Bedyk 2f7153a59c Convert README to reStructuredText
* convert README
* add syntax check

Story: 2002163
Task: 24461

Change-Id: I09e089f2c74684fef7f12d79b238002893942d4d
2018-08-09 17:47:46 +02:00
Dirk Mueller 530be8a934 Use a newer hacking (1.0.x)
Newer is better, and it doesn't seem to hurt :-)

Change-Id: I2bc261db013d6aa714fdea7d12b14052f9b0f6ce
2018-02-23 14:04:50 +01:00
Witold Bedyk 962a4d5fc8 Updated from global requirements
Change-Id: I50b940c588cbeb7bf2b3e490478cc3c1704c91df
2018-01-16 09:35:21 +01:00
Witold Bedyk 8229af83ef Update from global requirements
Change-Id: I5ae6513db8b4227501c7713ed1cc8d941413bccd
2017-11-15 16:54:00 +01:00
Witold Bedyk b75320bfc2 Manual update from global requirements
Change-Id: I882407cdb191c924bbfbce843fbe2abece71db21
2017-08-08 15:28:07 +02:00
Tomasz Trębski 75247c6257 Update to global requirements
Updates all outdates packages (compared to
requirements of openstack) to their proper
versions.

Change-Id: I0938df74935f3e9a9a80ea3cbb46eb806cdad9a2
2017-07-12 07:03:11 +02:00
Tomasz Trębski 0418111eaf Extend CI for monasca-agent
Following commit does several things:

* changes nose to ostestr
* enables coverage
* adds flake8 for tests
* adds bandit

Bandit note:
Multiple asserts of bandit had to be disabled at this
point because fixing them was not obvious. Several simple
asserts like B110 [try_except_pass] were fixed with

Closes-Bug: #1628740
Change-Id: I640857349008178e8a6f565e31ca2fde26ce8da7
2017-03-30 06:33:59 +02:00
Jakub Wachowski f87a29a364 Introduce DynamicCheckHelper class
This class shall be used to map external metrics from Prometheus, InfluxDB, ...
to well-formed Monasca metrics.

It supports:
* filtering by name (regex)
* renaming of metrics
* renamign of dimensions
* filtering by dimension value
* transforming of dimension values (regex based)

Change-Id: If0a5fdb1126bdfc93a88d5c1c7266d0c152d925f
2017-03-16 14:05:35 +00:00
ricolin f175c5fdb3 [Fix gate]Update test requirement
Since pbr already landed and the old version of hacking seems not
work very well with pbr>=2, we should update it to match global
requirement.
Partial-Bug: #1668848

Change-Id: I5df54461c5edf8de3339869cbceef36633c87f69
2017-03-02 19:21:34 +08:00
Dirk Mueller bad768ed9a Sync oslo/test-requirements with global-requirements
As an initial step to make monasca-agent coinstallable we
need to converge to use the OpenStack global-requirements

Change-Id: Icdaa769b114f83af3cff2274bd20ea6d74b8f944
2017-01-02 12:41:12 +01:00
Tomasz Trębski d95dec1c44 Sync to global-requirements
Following changes syncs requirements
of monasca-agent project to the openstack's
global requirements.

Needed-by: Ic1e157e7374885378223549644173adbed9c70dc
Change-Id: I0f48a72894ea07a7c67befb575e5cc1decdc3b5f
2016-12-06 13:00:26 +00:00
Roland Hochmuth 4f45eee63c Revert "Adjusting flake8 so that gate passes"
This reverts commit 5544199943.

Change-Id: I2f1a4c439ed907487628950ec167e99cfc97fe39
2016-11-09 01:50:01 +00:00
Roland Hochmuth 5544199943 Adjusting flake8 so that gate passes
Change-Id: I9c8859446c320b770e07de7e0c993dae8eaa4b0e
2016-11-08 15:55:16 -07:00
Joe Keen 84719cbd3e Restricting flake8 version
flake8 released a brand new 3.0.0 version today that doesn't work.

Change-Id: I01fd33d8da8c827bcc62309ec98165a259aba2c0
2016-07-25 13:39:42 -06:00
Joe Keen cf0914168f Updating unit tests
Change-Id: I2e54e928852de3add10f7c7fbc5b5c3a69a4108b
2015-08-20 16:35:55 -06:00
Joe Keen 1ded0b7b1c Fixing flake8 errors now that tox is working again
Change-Id: Id34991711c57f20922f003928008143032723af3
2015-07-30 14:47:02 -06:00
Christian Berendt caad7a3388 Change mode of requirement files
It is not necessary that the requirement files are executable.

Change-Id: I1224d7bd7ef8ef426f68c963ee9794e401e0a7f8
2014-08-13 09:27:04 +02:00
Christian Berendt ebfbd7f2d4 Add hacking as test requirement and use flake8 instead of pep8
Change-Id: Ia82e46d59c6dca0bb44e600dd8d512bbd3b98624
2014-07-24 11:44:37 +02:00
Jonathan Halterman 6b10dcd350 Initial tox setup and misc pep8 fixes.
Change-Id: I433900b95b5e223c359e9cb55565655810139177
2014-07-17 17:08:36 -07:00