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
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: I4ad020fbedd8106a3a86768c25a0c4dc750ec88a
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: I8560b5440c0c2338e468b12d8c4abcc47a8fb50a
When creating a LB + a listener with an allowed_cidr with the
fully-populated API, an issue happened when Octavia validated that the
allowed_cidrs and the VIP ip address have the same IP version. The
vip.ip_address value was not updated in the load balancer object,
forcing the expiration of the DB object before entering _graph_create
fixes this issue.
Note: there's no change in the tests, the test function for this feature
exists, looks correct, and passes successfully, the bug is only
reproducible in octavia-api.
Closes-Bug: 2057751
Change-Id: Ia106d81c1b2588e5d938d2238c8a2f6660bf5ef1
As noted on an earlier patch[1], the "SetAmphoraFirewallRules" task was not
checking the Amphora status nor using an API timeout. This could cause failover
flows to take longer than necessary if one of the Amphora is missing.
This patch corrects that issue by honoring both the Amphora status and timeout.
[1] https://review.opendev.org/c/openstack/octavia/+/910101/13/octavia/controller/worker/v2/flows/amphora_flows.py
Change-Id: Ic5e8140b13164267236f0a5d9a48fbd84bcdd688
There was a mistake in the load balancer create flow where duplicate
tasks were added to the flow when an SRIOV VIP was used. This patch corrects
that by removing the duplicate tasks.
Change-Id: Id3dce30639cce6724d41fd2ccd53612384eba87f
Redis Sentinel client implementation support using multiple sentinel
servers for redundancy, but only a single server from the servers list
was passed down to it.
This uses the new taskflow interface to add fallback servers, and
register the remaining servers in the list as fallbacks.
Depends-on: https://review.opendev.org/c/openstack/taskflow/+/907674
Change-Id: I6b281d2520db0048329b12b33108273ba2f96534
Redis introduced ACL feature in 4.0.0, and this feature is supported by
redis-py since 3.4.0[1]. When ACL is enabled, authentication requires
username in addition to password.
Also this removes the default password string because it can confuse
underlying libraries in case a more strict check such as 'is None' is
implemented there.
[1] 8df8cd54d1
Depends-on: https://review.opendev.org/c/openstack/taskflow/+/907667
Change-Id: Ie85589ab4e02046f54864a10b9b8adce6996d82a
This patch adds the initial nftables support in the amphora for SR-IOV
VIPs. Followup patches will add rules to the nftables chain. As this
point in the patch chain, SR-IOV VIPs will not pass any traffic.
Change-Id: Ib2a1c3f49a26690d2e0e9c7330e047748c0b5105
pylint 3.1.0 introduced the new check (use-yield-from) and this detects
a few failures in current code. This fixes these failures.
Change-Id: Ia5396895b27e4b28a7d9d8d85a85a8449c21d493
Print actual error when we failed to load pkcs12 cert and
falling back to the default implemntation, as exception may
not be related to certificate or its format like an issue
with wrong methods during cryptography version mismatch
*** AttributeError: module 'OpenSSL.crypto' has no attribute 'load_pkcs12'
Related-Prod: PRODX-39931
Change-Id: I85c8a615c4f2e08e28939805ae0e9b2028dadaed
Since 2023.2, we deprecated some settings in the [neutron] section
('endpoint', 'endpoint_type' and 'ca_certificates_file'), they are
respectively replaced by 'endpoint_override', 'valid_interfaces' and
'cafile'. There's some code in Octavia that automatically sets the new
settings if the user still has the old settings (it is required because
keystoneauth uses the CONF objects to establish the sessions).
But some corner cases were not correctly addressed in that patch.
Now Octavia ensures that the override of the parameters is correctly
handled.
Change-Id: Ic37e9f699e32431ae1735ddc9642689967ddc696
Closes-Bug: 2051604
We generate scripts using setuptools, and we don't expect users may
launch these processes directly from *.py files.
Change-Id: I31c812b112f587d8273893e565417e9949288d16
Newer Python detect 'has_calls' as an incorrect use of assert_has_calls.
Correct the one instance of this in Octavia.
Change-Id: I5c943266332908e00c19b409e3af571680d55c26
... to resolve the following ValueError.
```
ValueError: 'string' is not callable
```
The I202 test is disabled because multiple files need updates. It may
be enabled later once all the warnings are addressed.
Fixed E721 test errors which appears 4 times.
E721 do not compare types, for exact checks use `is` / `is not`, for
instance checks use `isinstance()`
Change-Id: I68880b83c8a555ed30c3ce18b73ae27b8db34dc8