Recent pep8 upgrade and corresponding pycodestyle update break
pep8 job due to the new rules.
This commit fixes the following new errors:
- E266 too many leading '#' for block comment
- E501 line too long
- H903 Windows style line endings not allowed in code
The following errors are added to the ignore list
as there are many errors:
- E402 module level import not at top of file
- E731 do not assign a lambda expression, use a def
- W503 line break before binary operator
Change-Id: I1fd3357479bb2ba3d89de92739ffac99900761b6
The tests are failing when executed separately with -m testtools.run
because they rely on another test class to register ml2 and ml2_vlan
option sections.
TrivialFix
Change-Id: I7a9a5c7c7f62783aceccd9e6ea62aacd9753d0d4
When l3 agent is restarted on a dvr_snat node that is configured
for L3_HA and has a centralized FloatingIP configured to the
qg-interface in the snat_namespace, that FloatingIP is not
re-configured to the qg-interface when agent starts.
The reason being, the cidr is not being retrieved from the
keepalived instance and only retrieved from the
centralized_fip_cidr_set.
If 'L3_HA' is configured we need to retrieve it from the keepalived
instance.
This patch fixes the problem by retrieving the cidrs from the
keepalived instance for the qg-interface.
Change-Id: I848a20d06e2d344503a4cb1776dbe2617d91bc41
Closes-Bug: #1740450
All FloatingIP for DVR_NO_EXTERNAL agents will be configured
in the SNAT Namespace. So there is no need to configure the
address scope related routes in the router namespace when the
agent is configured as DVR_NO_EXTERNAL.
Change-Id: I009dae9e7f485641f2f19dce8dd575da04bfb044
Related-Bug: #1753434
Post-binding information about router ports is missing in results of RPC
calls made by l3 agents. sync_routers code ensures that bindings are
present, however, it does not refresh router objects before returning
them - for RPC clients ports remain unbound before the next sync and
there is no necessary address scope information present to create routes
from fip namespaces to qrouter namespaces.
Change-Id: Ia135f0ed7ca99887d5208fa78fe4df1ff6412c26
Closes-Bug: #1759971
During listing router_ids on host it is possible that on some hosts
there are no L3 agents.
In such case AgentNotFoundByTypeHost exception is raised in
neutron.db.agents_db module in _get_agent_by_type_and_host() method.
Now this exception is properly handled during listing routers on host.
Change-Id: Ia5ff1b57ef63c98b4ada4f2d46c45336e413be3d
Closes-Bug: #1737917
A HA router should always be active unless all of the agents hosting
that router go down. In that event, the router should switch to
standby. This behavior changed with review:
https://review.openstack.org/#/c/411784
That review seemed to be accounting for a flakey message bus. This
change should account for that, but also revert to the original behavior
of the router state only changing when its backing agent hosts are down.
Change-Id: I89c3b2546382624f175f8de4de621c3e53adf527
Closes-Bug: 1682145
item_allocator class maintains the allocation of
items(link local address) from a given pool.
There may be cases where the key has been already
released or not being remembered while trying to
release it.
So it makes sense to lookup for the key before
releasing the key.
Change-Id: I34765dd3efa6c6742caeb7f6ae2ff14009dce6dd
Closes-Bug: #1761260
This patch intends to fix the reference URL after the recent change
in vpnaas [1]
[1] https://review.openstack.org/#/c/555167/
Change-Id: Icfec7fe3329c545d2f60c6e6cb7c28d4c05d6f36
If a distributed router has interfaces on multiple tenant networks, with
'fast exit' functionality policy based rules are created in qrouter
namespace for every tenant network subnet and 'from <cidr>' is included
into an 'ip rule' command invocation.
When a port on a tenant network is deleted 'from <cidr>' part is not
included and a first rule matching specified parameters gets deleted.
For example with the following layout
ip netns exec qrouter-4f9ca9ef-303b-4082-abbc-e50782d9b800 ip rule
0: from all lookup local
32766: from all lookup main
32767: from all lookup default
80000: from 192.168.100.0/24 lookup 16
80000: from 192.168.200.0/24 lookup 16
and neutron l3 agent will use this command
ip netns exec qrouter-4f9ca9ef-303b-4082-abbc-e50782d9b800 ip -4 rule\
del priority 80000 table 16 type unicast
and 192.168.100.0/24 rule will get deleted even if you actually removed
a port on 192.168.200.0.
This results in an extra rule present and not cleaned up and the right
rule removed. It is only recreated if a router is disabled and enabled
again.
additional changes:
1) Floating IP rules are identified by priority only as implemented
currently - for this reason this change adds fixed_ip to the rule
removal code. Rule priorities are 32-bit values in iproute2 so,
in theory, those should be not be used to cover IPv6.
2) IP protocol information for 'from all' rules is currently
derived from link-local address IP version. The same approach
is preserved by using version-specific /0 addresses without
changing the API provided by ip_lib.
Change-Id: I0ea6dddd26e17771be223a1fbdf21792c90f3e9c
Closes-Bug: #1759956
'IPWrapper.get_namespaces()' is deprecated in version 'Queens'
and was marked to be removed 'Rocky'.
This patch removes it and switches to use
'neutron.agent.linux.ip_lib.list_network_namespaces' instead.
Change-Id: I090cc5841aca5b638d08d65645162811950d6437
Depends-On: Id629481fd722004a7b7d827bf6209785f85f4c64
After the merge of [1], the DHCP agent will fail to configure a routed
network when attempting to generate host routes for a non-local subnet
that is also isolated from the point of view of the metadata service.
This patch adds a check to make sure that the host route is not added
for non-local subnets.
[1] https://review.openstack.org/#/c/468744
Change-Id: Ia03f538a7d2d10d600d9359da5b3a74532709d1f
Closes-Bug: #1758952
Add error handling for get_network_info_for_id rpc call in the
ovs_dvr_neutron_agent.
Closes-Bug: #1758093
Change-Id: I44a5911554c712c89cdc8901cbc7b844c4b0a363
The multiprovidernet API extension's definition was rehomed into
neutron-lib with commit If3367e6a14074a6225bba527e8f7e38c51280f85
This patch consumes it by:
- Using the APIExtensionDescriptor and API definition for the extension.
- Removing the rehomed (now duplicated) code from neutron.
- Using lib's code were applicable.
NeutronLibImpact
Change-Id: I12c15c360f8bf5a45fbe70e5ed1202ef0e7ec0f0
Fullstack job's failure rate is reasonable since few weeks,
job is already working as "voting" and there is no problem
with that.
Because of that it is now added also to gate queue.
Change-Id: I346c3c97b26932e2f02893cf5f3b63090cd81ee0
'Versions.factory()' is deprecated in version 'Queens'
and was marked to be removed 'Rocky'.
This patch removes it and switches to use
neutron.pecan_wsgi.app.versions_factory instead.
In addition, neutron.api.versions is removed
because this deprecated module isn't used anywhere.
Change-Id: I08d1725a973c734b55771918915428377fb7d3b4
The service type extension's API definition was rehomed into neutron-lib
with commit I301f74d09eb4c0f1d8a0e065403da59e222b78e3
This patch consumes it by removing the rehomed code in neutron and using
the def from neutron-lib.
NeutronLibImpact
Change-Id: I30659530c557426fbf4da6cc60892345f3be006e
The option is currently defined in two places - as a generic agent
option and as a sriov agent specific one. This is a problem now that
oslo.config tracks location where options are defined
(I6dec1e09dcab203c6287f9c56c866f220a42f850) because when unit test
runner imports all modules, it registers the option from those two
separate locations, and since locations are different, it's considered
the options are duplicate, which results in the following error:
DuplicateOptError: duplicate option: polling_interval
To fix the issue, I removed the definition of the option from sriov
module and made sure the common agent options are registered whenever
the sriov module is imported.
Change-Id: I485532692f4b3a5804885e0325a8352fe6b1aa65
Closes-Bug: #1759345
Currently, errors related to lack of microversion support are completely
masked because of the way eventlet.spawn_n() works. These changes
improve error handling so that deployers are explicitly notified when
Nova API microversions are not supported. This is useful because without
microversion support, the entire flow will break and hosts will not be
associated with segments properly. Deployers will have no idea why
because errors are not printed to log files setup by the standard Python
logging framework.
Related-Bug: #1759004
Change-Id: I9c6151ffa90394612e7f81ededd4a309dd8ab7fb