async_process.py and ovsdb_monitor.py are now platform
independent, for which reason we can move them to
neutron/agent/common.
Note that a few subprojects are using async_process. We'll use
debtcollector so that we don't break those projects, while logging
a deprecation warning.
Change-Id: I6a7418cb8680cd71fe16c5d98b9b09ef2d260d37
In case when external bridge configured in OVS agent's bridge_mappings
will be destroyed and created again (for example by running ifup-ovs
script on Centos) bridge wasn't configured by OVS agent.
That might cause broken connectivity for OpenStack's dataplane if
dataplane network also uses same bridge.
This patch adds additional ovsdb-monitor to monitor if any
of physical bridges configured in bridge_mappings was created.
If so, agent will reconfigure it to restore proper openflow rules
on it.
Change-Id: I9c0dc587e70327e03be5a64522d0c679665f79bd
Closes-Bug: #1768990
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
ovsdb-client monitor attempts to connect to ovs via the
ovsdb_connection if it is set. Since it is set by default, we need
to ensure that OVS is listening on the socket before calling
ovsdb-client monitor.
Closes-Bug: #1669893
Depends-On: Ibde5417d005265d27e939ca29788c21f73b38980
Change-Id: Ia34b9d599b522dd12ef088100c2b68a75a78d797
When using XenServer as hypervisor, we found we cannot set ovs
agent which runs in compute node with "minimize_polling=True".
Because once set it True, the ovs agent will monitor the local
ovsdb, but we want it monitor ovsdb in Dom0.
This patch is to add support for ovsdb-client to monitor remote
connection.
Change-Id: Idf2a564e96626dab3c4421a1f9139ed9ffcbcab1
Closes-bug: 1647914
By default, wait_until_true uses default exception from eventlet which
is eventlet.TimeoutError. This class is not subclass of Exception but
BaseException. In case wait_until_true times out in any test, the whole
test executor worker is stopped leaving scheduled tests not executed.
This patch replaces eventlet.TimeoutError with new WaitTimeout
exception, that inherits from Exception and thus won't break execution
of other test cases in case it's raised.
Related-Bug: 1625221
Change-Id: I44c0c22f427f61d84963e6e59393b90fbaa8f058
This adjusts the event handling logic in the ovs interface
monitor to watch for 'new' events as well because this is
when ofports are assigned to the interface. Previously we
were only watching for 'insert' events, which would never
include the ofport so this led to every port being skipped
initially by the OVS agent and then picked up on the next
polling interval.
Closes-Bug: #1560464
Change-Id: I46ac508a839c6db779323d5afb083f3425f96e87
- 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
It's not used anywhere outside tests, and there are better ways to
wait for updates.
The flag was once used to influence the state of activeness for the
monitor, but not anymore [1].
This cleanup also allows us to remove custom _read_stdout from the
monitor and reuse the one inherited from AsyncProcess. Meaning, we
also can safely get rid of another pile of duplicate tests.
[1]: I05faeddd061ab45af51c044a10462c3a57593d4d
Change-Id: I612d492c8f65a70e18f782a5e4d055de5f7948ef
Those methods do the same thing as AsyncProcess counterparts, just
with logging the received output. It's better to move the logging into
AsyncProcess and control it with __init__ arguments.
This allows us to get rid of some duplicate tests for ovsdb monitor.
Change-Id: Ic20ded27ba09afdd73e4d96c47469c2d7b4d4db5
Related-Bug: #1495937
ofport is usually an integer but when a port is not ready
ofport is an empty set.
This patch makes SimpleInterfaceMonitor handle that case too.
Change-Id: I91611d73e8d5551fc458082ce021cbeb5123a6f2
Closes-bug: #1485206
OVSDB monitor can generate the events that the OVS agent
needs to process (device added or updated). Instead of
notifying only that a change occurred and that polling
is needed, pass the events to the agent
Change-Id: I3d17bf995ad4508c4c6d089de550148da1465fa1
Partially-Implements: blueprint restructure-l2-agent
is_active property from SimpleInterfaceMonitor shadows
the method is_active inherited from AsyncProcess.
The property checks that ovsdb monitor is running and
that it received some data. When ovsdb monitor starts
it always receives data, since it processes the interfaces
present on the machine, so the flag data_received will
always be set to true right after SimpleInterfaceMonitor
starts. Considering that, is_active can be removed and
the method is_active inherited from AsyncProcess can be
used instead.
Change-Id: I05faeddd061ab45af51c044a10462c3a57593d4d
It's mostly a matter of changing imports to a new location.
Non-obvious changes needed:
* pass overwrite= argument to oslo_context since oslo.log reads context
from its thread local store and not local.store from incubator
* don't store context at local.store now that there is no code that
would consume it
* LOG.deprecated() -> versionutils.report_deprecated_feature()
* dropped LOG.audit check from hacking rule since now the method does
not exist
* WritableLogger is now located in oslo_log.loggers
Dropped log module from the tree. Also dropped local module that is now
of no use (and obsolete, as per oslo team).
Added versionutils back to openstack-common.conf since now we use the
module directly from neutron code and not just as a dependency of some
other oslo-incubator module.
Note: tempest tests are expected to be broken now, so instead of fixing
all the oslo.log related issues for the subtree in this patch, I only
added TODOs with directions for later fix.
Closes-Bug: #1425013
Change-Id: I310e059a815377579de6bb2aa204de168e72571e
Removes the root_helper arg from AsyncProcess and areas whose use
of root_helper was soley for passing it to AsyncProcess.
Change-Id: I6c34f2d8466444c82f8712a2a765975695795fd7
Partially-Implements: rootwrap-daemon-mode
Mostly trivial import changes.
- oslo.i18n no longer provide install() method to inject _() into
globals(), so removed all calls to it;
- removed Babel from dependencies (it will now be grabbed by oslo.i18n);
- updated tox.ini to ignore import violations for oslo.i18n.
Change-Id: I6623d551f512fb7fe9bf35ee734ed6d4c6cbc287
Don't translate debug level logs and enforce log hints
Our translation policy
(https://wiki.openstack.org/wiki/LoggingStandards#Log_Translation) calls
for not translating debug level logs. This is to help prioritize log
translation. Furthermore translation has a performance overhead, even if
the log isn't used (since neutron doesn't support lazy translation yet).
NOTE: this is done on a directory by directory basis to ensure that we
do not have too many conflicts and rebases.
Add a local hacking rule to enforce this.
This patch set enforces the directory neutron/agents
Partial-bug: #1320867
Change-Id: I4bd562e5138c2d2850072440aa121f27e902463a
When registering a new eventlet.timeout.Timeout object, eventlet
automatically starts a timer for most (if not all) future eventlet
calls. Normally, eventlet codes do not hold a timeout unless such a
timeout is used or a specific timeout length is specified through
the API, but once a Timeout object is initialized, it is left there
unless canceled.
This change fixes an un-canceled Timeout which causes some
functional tests to fail, reintroduces a fix for bug #1358206,
which was written prior to discovering the uncanceled timeout, and
increases the timeout of a test that depended on this timeout.
Closes-bug: #1358206
Related-bug: #1364171
Change-Id: I1bfc5af6917c525894eecd8b477d787763edbd02
The current timeout fails during functional testing with
slightly higher load. Increasing it will lower the timeout
chances during high load conditions. Changed from 5 seconds
to respawn_interval/2. DEFAULT_OVSDBMON_RESPAWN = 30 , so
the default timeout will be 15 seconds.
Change-Id: I6a9e2977b275e96dcf01c4df90a33169c42287d6
Closes-Bug: #1358206
This patch changes get_vif_port_set in order to not return
OVS ports for which the ofport is not yet assigned, thus avoiding
a regex match failure in get_vif_port_by_id.
Because of this failure, treat_vif_port is unable to wire
the port.
As get_vif_port_by_id is also used elsewhere in the agent, it has
been enhanced in order to tolerate situations in which ofport might
have not yet been assigned.
The ofport field is added to the list of those monitored by the
SimpleInterfaceMonitor. This will guarantee an event is generated
when the ofport is assigned to a port. Otherwise there is a risk
a port would be never processed if it was not yet ready the first
time is was detected. This change won't trigger any extra processing
on the agent side.
Finally, this patch avoids fetching device details from the plugin
for ports which have disappeared from the OVS bridge. This is a
little optimization which might be beneficial for short lived ports.
Change-Id: Icf7f0c7d6fe5239a358567cc9dc9db8ec11c15be
Partial-Bug: #1253896
This change adds the ability to monitor the local ovsdb for
interface changes so that the l2 agent can avoid unnecessary
polling. Minimal changes are made to the agent so the risk
of breakage should be low. Future efforts to make the agent
entirely event-based may be able to use OvsdbMonitor as a
starting point.
By default polling minimization is not done, and can only be
enabled by setting 'minimize_polling = True' in the ovs
section of the l2 agent's config file.
Closes-Bug: #1177973
Change-Id: I26c035b48a74df2148696869c5a9affae5ab3d27