This patch adds the availability_zone attribute to agents and
supports availability_zone API.
Availability_zone support for resources (network/router) and
the schedulers are included in subsequent patches.
Ihar Hrachyshka [Thu, 1 Oct 2015 15:13:25 +0000 (17:13 +0200)]
metadata: don't crash proxy on non-unicode user data
We attempt to log every successful metadata response with LOG.debug. But
as per oslo.log docs [1], we should make sure that what we pass into the
library is unicode.
Http.request returns a tuple of Response object and a string, which is
bytes in Python 2.x [2].
That's why we need to convert the response content to unicode before
passing it into oslo.log.
To achieve it, we utilize encodeutils.safe_decode with 'replace' errors
handling strategy, so that we don't get exceptions on input that does
not conform unicode.
For the unit test case, we pass a string that is not expected to convert
to unicode with errors='strict' strategy or similar, and check that we
still don't crash.
While at it, we remove a check for the number of log calls being
triggered, because it's something that we should avoid validating in
test cases, and it cannot trigger a real bug. The mock that was used to
count the number would also hide the bug that we try to reproduce.
Note that the bug does not require debug to be set because the crash
occurs before oslo.log machinery decides it should not log the message.
Brian Haley [Tue, 29 Sep 2015 15:31:34 +0000 (11:31 -0400)]
Add IPDevice.exists() method
Some callers of ip_lib.device_exists() have already instantiated
an IPDevice object, let's move the device existence check into
the IPDevice class so they can call it directly.
James Page [Thu, 1 Oct 2015 10:54:28 +0000 (11:54 +0100)]
Use format to convert ints to strings
This ensures that on 32bit architectures, where
sometimes an implicit long is created, the resulting
string does not contain a 'L' suffix as generated
by the hex function.
Carl Baldwin [Wed, 30 Sep 2015 20:12:23 +0000 (20:12 +0000)]
Remove is_ha property from the router
This was a todo left over from refactoring. The one place where it
was used was in the metadata driver which can just as easily check
isinstance.
The is_ha property in the HA class only returned True if self.router
was True. The agent sets this on creation and so it will always be
True. Additionally, it didn't really make sense to me anyway given
the way this was being used in the metadata driver.
This optimization is needed for big clusters with hundreds
of agents where the spike of activity may trigger a burst
of RPC requests that would prevent neutron-server from processing
agent heart beats in time, triggering resource rescheduling.
This will be further optimized by running dedicated RPC workers
for state reports processing.
Henry Gessau [Sun, 27 Sep 2015 19:36:59 +0000 (15:36 -0400)]
Tag the alembic migration revisions for Liberty
Previously when we had one repo with one alembic branch we would
create a milestone revision on that single branch. Now we have
multiple repos and expand/contract branches for each repo.
So from now on we tag the final revision on every branch when we make
a milestone release. Update the cli to support the command:
neutron-db-manage upgrade <milestone>
where <milestone> becomes an alias for all the revisions for a
milestone.
Terry Wilson [Mon, 28 Sep 2015 22:42:25 +0000 (17:42 -0500)]
Check idl.run() return value before blocking
The IDL change_seqno can change as a result of running idl.run(), and
it returns True if there has been a change. The existing code would
block without checking the return value, and therefor could block
until another change occurred, or the timeout was reached.
For IP CIDR, D class is for multicast, but neutron does not
check this, if user create a subnet like '224.0.0.1/16', DHCP
agent will fail to spawn Dnsmasq service.
This patch adds a check, if subnet CIDR is D class or loopback,
neutron-server will raise a error.
The resource_identifier hooks has been removed as the Pecan
controllers are now able to identify by themselves the resource
they operate for.
However the unused hook module was never removed thus making it
'undeed'. This patch simply fires it a silver bullet thus ensuring
it will be gone forever.
Handle empty bridge case in OVSBridge.get_ports_attributes
Before this patch, get_ports_attributes would call
get_port_name_list. In the case of an empty bridge,
get_port_name_list would return an empty list and feed that
in to ovsdb.db_list, thereby returning all ports instead of
no ports.
This patch adds a policy.rst document which describes how the
neutron.policy module works, how it uses oslo_policy and how
it's wired in API controllers.
The patch also remove an obsolete docstring from neutron/policy.py
The fix for https://review.openstack.org/#/c/218350/ has few
more occurrences. This patch addresses those and also changes
"local_port" from "port" in order not to confuse the parameter
with method argument.
Now that we forbid branch points as part of check_migration, there is no
technical need in maintaining the file. It only slows down developers that are
forced to resolve git conflicts after every new migration merged.
We remove the file as part of new 'revision' generation.
Now that the file is not present, we introspect the alembic scripts to
determine whether the subproject uses split migrations (presense of a branch
point indicates that).
Andreas Jaeger [Thu, 24 Sep 2015 18:48:59 +0000 (20:48 +0200)]
Cleanup of Translations
In preparation for the release, do some cleanups for translations.
Removes all po files that are partially translated. The translation
team has decided to exclude files with less than 66 % of translated
content. There is no content lost, all data is in the translation
server, we just remove it from the repository.
This updates also recreates pot (translation source files) to
reflect the state of the repository in case there was no recent
import for them.
This change needs to be done manually since the automatic import does
not handle some of these cases.
SimpleInterfaceMonitor: get rid of self.data_received flag
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.
Fixes 'ovs-agent fails to start on Windows beacause of SIGHUP'
Change Ic0cf8a9ca7f3a16b556a6825e2979471ae136c33 has added the handling
of SIGHUP in neutron_ovs_agent. This does not work on Windows as there is
no SIGHUP signal on windows.
The fix consists in checking if signal has SIGHUP attr before setting the handler
for SIGHUP.
Forbid more than one branch point in alembic dependency chains
This change will allow us to get rid of HEADS file that currently serves as a
caution guard against excessive branching due to git conflicts it invokes on
any new migration merged.
This simple patch ensures usage for security group rules is
marked as dirty when a security group rule is deleted.
To this aim, the security group rule is deleted using ORM
in order to ensure the sqlalchemy even if fired.
Fixes 'ovs-agent cannot start on Windows because root_helper opt is not found'
Change Ie1224f8a1c17268cd7d1c474ed82fdfb8852eaa8 removed
config.register_root_helper() from ovs_neutron_agent:main, thus the agent
cannot start on Windows since root_helper config option is never
registered.
The fix consists in adding config.register_root_helper in the Windows side
utils.
The link to Dashboard is broken in the generated docuemnt
http://docs.openstack.org/developer/neutron/
This patch fixes it and addresses warnings so that
tox -e docs works.
Also add a reference to Gerrit Dashboard Creator
so that developers can customize it to what they want.
Miguel Lavalle [Tue, 22 Sep 2015 22:22:31 +0000 (17:22 -0500)]
Eliminate autoaddress check for DNS integration
The autoaddress check for DNS integartion is not required anymore. It is
removed from the DB plugin. This check was being performed to reflect
incorrect functionality in the DHCP agent as indicated in bug
https://bugs.launchpad.net/neutron/+bug/1498665
Carl Baldwin [Wed, 16 Sep 2015 21:53:54 +0000 (21:53 +0000)]
Only get host data for floating ips on DVR routers
First, we are only interested in setting the host attribute when
the router is a DVR router. Second, we don't need to query all of
the ports on the host, we just need to query the ports that are
referenced by the set of floating ips that we already have.
Ryan Moats [Mon, 21 Sep 2015 20:56:26 +0000 (15:56 -0500)]
Link dashboards into generated documentation
Move the dashboard directory under the source tree so that
it is available on generated builds. In addition, recast
image pages as RST so that they will be rendered
Change-Id: I316128491e8dae70ac06e260f5bdd8f440d285aa Signed-off-by: Ryan Moats <rmoats@us.ibm.com>