Commit Graph

13 Commits

Author SHA1 Message Date
Boden R 9bbe9911c4 remove neutron.common.constants
All of the externally consumed variables from neutron.common.constants
now live in neutron-lib. This patch removes neutron.common.constants
and switches all uses over to lib.

NeutronLibImpact

Depends-On: https://review.openstack.org/#/c/647836/
Change-Id: I3c2f28ecd18996a1cee1ae3af399166defe9da87
2019-04-04 14:10:26 -06:00
Inessa Vasilevskaya 7322bd6efb Make code follow log translation guideline
Since Pike log messages should not be translated.
This patch removes calls to i18n _LC, _LI, _LE, _LW from
logging logic throughout the code. Translators definition
from neutron._i18n is removed as well.
This patch also removes log translation verification from
ignore directive in tox.ini.

Change-Id: If9aa76fcf121c0e61a7c08088006c5873faee56e
2017-08-14 02:01:48 +00:00
Brian Haley 0629129c03 DVR: Look at all SNAT ports for a subnet match
For IPv6, the csnat port list could have multiple
subnets contained in it, but we were only ever
looking at the one associated with the first fixed
IP when trying to match an internal port.  Change
to check all subnets on all port combinations
(internal and csnat) before giving up.

Change-Id: I9c0ac933c08734a3f6738a233fdf6021ce9bd375
Closes-bug: #1624515
2017-02-06 12:05:05 -05:00
Robert Li e48caf6736 Add agent object in router info
agent object is a member of some sub classes of RouterInfo such as
HaRouter. This changeset makes it a member of the RouterInfo class
itself.

Prior to the change, the agent object has been passed in to some
methods of RouterInfo that requires it to access the agent object's
member information. The bugs in concern requires calling the PD object
that is a member of the agent object to get IPs that need to be
preserved in the gateway port. Without this change, signatures of the
methods external_gateway_added() and external_gateway_updated() have
to be modified to pass in the agent object. And any subclass of
RouterInfo that overwrites or uses the methods must be changed as
well. It doesn't seem to make sense considering the subclass such as
HaRouter has the agent object as one of its members already.

The changeset fixes the bugs by preserving the LLAs for prefix
delegation when the gateway port is being updated.

Closes-Bug: #1639042
Closes-Bug: #1640271

Change-Id: I61c6128ed1973deb8440c54234e77a66987d7e28
2016-12-19 17:08:23 -05:00
Swaminathan Vasudevan acd04d668b DVR: Clean stale snat-ns by checking its existence when agent restarts
At present there is no clear way to distinguish when the snat_namespace
object is initialized and when the actual namespace is created.
There is no way to check if the namespace already existed. The
code was only checking at the snat_namespace object instead of its
existence.

This patch addresses the issue by adding in an exists method to the
namespace object to identify the existence of the namespace in the
given agent.

This would allow us to check for the existence of the namespace,
and also allow us to identify the stale snat namespace and
delete the namespace when the gateway is cleared as the agent restarts.

This also applies for conditions when the router is manually moved
from one agent to another agent while the agent is dead. When the
agent wakes up it would clean up the stale snat namespace.
Change-Id: Icb00297208813436c2a9e9a003275462293ad643
Closes-Bug: #1557909
2016-08-04 10:39:15 -07:00
Ryan Moats 300f73d489 Refactor router delete processing
The discussion in [2] indicated that [1] would lead to orphaned
items during error cases.  This refactoring replaces the
optimistic approach followed by [1] with a separate delete code
path that does not execute the operations that take place within
the namespace that will be removed.  Operations that take place
outside of those namespaces are still performed to ensure that
no orphaned items result.

A comment has been added to the functional test to explain what
case is being tested.

[1] https://review.openstack.org/#/c/240971
[2] conversation starting at http://goo.gl/bZgvqW

Change-Id: I663f1264fb3963789b79a4a7c3e46d232b2f0620
Signed-off-by: Ryan Moats <rmoats@us.ibm.com>
2016-01-15 09:37:37 -06:00
Doug Wiegley dd726ed494 Move i18n to _i18n, as per oslo_i18n guidelines
- This does NOT break other projects that rely on neutron.i18n,
  as this change includes a debtcollector shim to maintain those
  older entry points, until they can migrate.
- Also updates _i18n.py to the latest pattern defined by oslo_i18n
- Guidance and template are from the reference:
  http://docs.openstack.org/developer/oslo.i18n/usage.html

Partially-Closes-Bug: #1519493
Change-Id: I1aa3a5fd837d9156da4643a367013c869ed8bf9d
2015-12-01 19:29:10 -07:00
Ryan Moats 526dac467b Optimize router delete execution
Optimize the execution of router delete in the L3 agent
by not performing operations in the router namespace that
will be removed as the last step of the workflow.
Comparing the slopes of the least squares fit of delete
execution time shows that this optimization decreases that
slope by over half.

Change-Id: Ic425ab1f8c3afe882c9deaa72a814ac0d2053f3b
Signed-off-by: Ryan Moats <rmoats@us.ibm.com>
Closes-Bug: 1512450
2015-11-23 23:50:02 -06:00
Swaminathan Vasudevan e0664a4c2c Fixes SNAT port not found for internal port
For every router interface added to a router
with a default gateway there will be an internal
SNAT port generated and will be required by the
L3 Agent to process the SNAT rules.

This bug was introduced by the change ID below
Icc099c1a97e3e68eeaf4690bc83167ba30d8099a.

When the gateway is removed these ports have to
be removed from the namespace. These ports are
cached in the router_info and should be provided
to the get_snat_port_for_internal_port function
when called from external_gateway_removed or when
called from _dvr_internal_network_removed.

This patch fixes this problem.

Closes-Bug: #1496578

Change-Id: Id5af4774ba246e24f343f5623af5ea9143bd5f6b
2015-09-18 11:21:35 -07:00
Jenkins ff2a3d2456 Merge "Add snat ports cache to dvr router" 2015-09-05 17:43:51 +00:00
Swaminathan Vasudevan 177f738ffe Fix DVR log strings in agent
This patch fixes a couple of DVR log strings that
was not reporting the right information.

Change-Id: Ic6919d00214a001ecdaa709c4e0f01a84adab2c7
2015-08-27 09:26:42 -07:00
Carl Baldwin 3a9e778399 Add snat ports cache to dvr router
This reverses the effect of [1] but in a way that works with the
current structure of the code and keeps DVR details in DVR classes

[1] https://review.openstack.org/#/c/200293

Change-Id: Ia8468881de6538882d4a14725b55db53e23d2e4c
Closes-Bug: #1479130
2015-08-26 21:11:58 +00:00
Carl Baldwin 701b119d9c Create dvr base class and stop passing around snat_ports
The one thing that I see that the two dvr classes have in common is
the ability to map internal ports to snat ports.  The dvr local router
needs it to set up a redirect to the central part.  The central part
needs it to create the port for the internal network.

This change renames the mapping method to something more logical and
removes snat_ports as an argument to two methods because it is a quick
O(1) operation to get it from the router dict and passing it around
just tangles things up.

Change-Id: Icc099c1a97e3e68eeaf4690bc83167ba30d8099a
2015-07-15 18:36:40 +00:00