Ran `flynt octavia` in order to replace old style string format with
f-strings.
Manually corrected lines that got too long and some occurences that were
not converted to f-strings.
Change-Id: I228a78baf2f4b6c47229d7dce1fcd81ef27c0030
The simplejson library has been generally used in OpenStack in the past
to implement compatibility with Python 2 and Python 3. However now
python 2 is no longer supported, and we can use the built-in json
module.
Note that the built-in json module does not accept byte values, while
these were automatically decoded by simplejson using utf-8 encoding.
Add encoding option to all subprocess calls so that outputs are all
encoded strings and can be passed directly into json data.
Change-Id: Ibfd47e87994511198d8883a91978be542dac3a3e
The previous patch[1] that added a check for Amphora status missed
adding a task that generates the Amphora status information when a
listener is updated.
This patch corrects that by adding the AmphoraeGetConnectivityStatus
task to the firewall rules subflow.
[1] https://review.opendev.org/c/openstack/octavia/+/912599
Change-Id: I325de85b03080db646da847b58c15c3fbbdc6be2
Fix the following new errors detected by pylint 3.2.0.
- possibly-used-before-assignment
- used-before-assignment
- useless-return
Change-Id: Ibfa282e7311a06ed69797cb9969aa66459372d79
The option was deprecated in Victoria release[1] and has had no effect
since then.
Also remove the deprecated [health_manager] stats_update_driver option
which was renamed by the same commit.
[1] 5092597f6b
Change-Id: I690428bae49dc594eacae08d40612e4d1f7523a1
When filtering the GET calls with a boolean attribute, the value of the
attribute was a string and not a boolean, it made the queries incorrect.
Now, every boolean attribute is converted from a string to a boolean
before querying the DB.
Closes-Bug: #2045803
Change-Id: I9aea55371d3f3d054eba5673d09eead23d5c95a8
test_main may have randomly failed when running multiple tests in
parallel because ThreadingHTTPServer was not mocked, so a server was
created, this commit fixes this issue, the server is no longer
instantiated and is now mocked.
Change-Id: I2415aafaebd340e4a07b85df2c8917244266ed4c
Closes-Bug: #2039245
When reloading haproxy, check if a "<service> is not active, cannot
reload." error is triggered by systemd, it means that haproxy crashed
during the reload. When this error is detected, verify if haproxy has
reloaded correctly (check the socket and its uptime).
Related-Bug: #2054666
Change-Id: Ibadf6e529d53fb5a45b73af57243cee5a3f70d9b
The autoload arugment was removed[1] in SQLAlchemy and only
the autoload_with argument should be passed.
The autoload argument is set according to the autoload_with argument
automatically even in SQLAlchemy 1.x[2] so is not at all needed.
[1] c932123bac
[2] ad8f921e96
Closes-Bug: #2061303
Change-Id: Ic18044b8065d2350c180ad26f5307a77aa99037b
Octavia replace "limit" with None when it is less 1. (for example 0, -1)
However the further code failed to compare None and int values.
This patch fixes it by validation, that limit is None.
Co-Authored-By: Roman Goncharov <gadzhet007@gmail.com>
Closes-Bug: #2060917
Change-Id: I9bb45a1aca6b7b18644752a3dccc3ebfb7c106ef
Result of running
$ pyupgrade --py38-plus $(git ls-files | grep ".py$")
This was inspired by Nova [1]
Fixed PEP8 errors introduced by pyupgrade by running:
$ autopep8 --select=E127,E128,E501 --max-line-length 79 -r \
--in-place octavia
and manual updates.
[1]: https://review.opendev.org/c/openstack/nova/+/896986
Change-Id: I9399730fed16b85686caa586788a1bc03ebd123a
Result of running
$ pyupgrade --py38-plus $(git ls-files | grep ".py$")
This was inspired by Nova [1]
Fixed PEP8 errors introduced by pyupgrade by running:
$ autopep8 --select=E127,E128,E501 --max-line-length 79 -r \
--in-place octavia
and manual updates.
[1]: https://review.opendev.org/c/openstack/nova/+/896986
Change-Id: I3924de7cd8e2d242006ec4f272ece0276053e2ed
Result of running
$ pyupgrade --py38-plus $(git ls-files | grep ".py$")
This was inspired by Nova [1]
Fixed PEP8 errors introduced by pyupgrade by running:
$ autopep8 --select=E127,E128,E501 --max-line-length 79 -r \
--in-place octavia
and manual updates.
[1]: https://review.opendev.org/c/openstack/nova/+/896986
Change-Id: I9aeb3d603a519c3029b5be1ab622a0250f628f7d
Result of running
$ pyupgrade --py38-plus $(git ls-files | grep ".py$")
This was inspired by Nova [1]
Fixed PEP8 errors introduced by pyupgrade by running:
$ autopep8 --select=E127,E128,E501 --max-line-length 79 -r \
--in-place octavia
and manual updates.
[1]: https://review.opendev.org/c/openstack/nova/+/896986
Change-Id: I7d69a002c4e4c79fc2f5a13e9056aa2461d0ab7a
Result of running
$ pyupgrade --py38-plus $(git ls-files | grep ".py$")
This was inspired by Nova [1]
Fixed PEP8 errors introduced by pyupgrade by running:
$ autopep8 --select=E127,E128,E501 --max-line-length 79 -r \
--in-place octavia
and manual updates.
[1]: https://review.opendev.org/c/openstack/nova/+/896986
Change-Id: Ib160f988cea0c6a27b3c1efeb2b2953f8929dc5c