Commit Graph

9 Commits

Author SHA1 Message Date
Gregory Thiemonge ff8c3aa7e2 Fix new pep8/pylint warnings
Fixed: Consider using {} instead of a call to 'dict' (use-dict-literal)
Fixed: Unnecessary parens after '=' keyword (superfluous-parens)
Fixed: Metaclass class method __new__ should have 'mcs' as first
       argument (bad-mcs-classmethod-argument)

Added: Raising too general exception: Exception (broad-exception-raised)
to the ignore list
This new warning should be addressed in a follow-up patch, not in a
quick fix for unblocking the CI.

Change-Id: I1fdb804d7b561bb3a746d14a51b50edcd445dbe6
2023-02-03 09:05:17 +01:00
Michael Johnson d590d6c705 Fix new pylint issues
The new pylint release removed a few rule sets and added a check for generators. This patch updates Octavia for those changes.

Change-Id: I2261342377e7acb1d2bc4fc742a351dfc66e4305
2022-06-10 10:20:08 +00:00
Adam Harwell ba5b4a7fb5 Fix some new pylint errors
Also squelch warnings about f-string usage for now (unless folks think
we should do that entire refactor here).

Change-Id: I193abaebdaca10d353e2dbaa14df110048ffaa58
2021-09-16 21:58:43 -07:00
Gregory Thiemonge 4a9de5b27a Fix new pylint issues
new pylint 2.9.0 provides some new checkers and detects new errors with
existing checkers:
- consider-using-enumerate (disabled)
- consider-using-from-import
- arguments-renamed (disabled)
- consider-using-with
- consider-using-dict-items

Change-Id: I4651f8bdaca13486a1dc6408f445d41779a95653
2021-06-30 11:07:03 +02:00
Michael Johnson 78b1263237 Add long-running provider agent support
This patch adds support for long-running provider driver agents to
the Octavia driver-agent.
It will fork a process for all of the enabled provider driver
agents at startup.

Change-Id: Ib7042bcc48b1dd5b37b671dd5e64728b71ab9542
Story: 2006250
Task: 35863
2019-09-10 22:25:50 +00:00
Carlos Goncalves c4faac25de Add Python 3.7 support
In order to support Python 3.7, pylint has to be updated to 2.0.0
minimum. Newer versions of Pylint enforce additional checkers which can
be addressed with some code refactoring rather than silently ignoring
them in pylintrc; except useless-object-inheritance which is required to
be silented so that we stay compatible with Python 2.x.

Story: 2004073
Task: 27434

Change-Id: I52301d763797d619f195bd8a1c32bc47f1e68420
2019-05-14 17:11:22 +00:00
Michael Johnson 14cb07f2d9 Move from platform.linux_distribution to distro.id
The builtin platform.linux_distribution[1] is deprecated and will be
removed in 3.8 and the recommended replacement is distro.
This also raises a "deprecated method" error in pylint.

This patch moves us over to the future by following the recommendation
in the python docs and switching to use the "distro" module.

[1] https://docs.python.org/2/library/platform.html \
    #platform.linux_distribution

Depends-On: https://review.openstack.org/578983
Change-Id: I29e2673572eab75b553da6b01143b007701808fd
2018-06-29 17:25:54 -07:00
Doug Hellmann 0322cbc5c3 fix tox python3 overrides
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.

We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.

We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.

This patch also updates pylint to 1.5.6 which is compatible with
python3.
In updating pylint we have some issues to correct, this patch addresses
those issues so the Octavia code passes pylint 1.5.6.

Change-Id: Iec21f4c803a427059d595612336d67a35ebf9585
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-27 09:32:00 +08:00
Dong Jun 344b8fa871 Support pylint
Support pylint for octavia, some harmless rules are added to messages
control group.

Change-Id: I88577b1ab918fc7a19b2323ca652bde7ffad64ef
2017-10-16 09:32:41 +08:00