In create/update_subnet(), IP address fields (cidr, gateway_ip, host_routes,
dns_nameserver) should be checked whether they are consistent with IP version
specified. IP version check for allocation_pools is already implemented,
so this commit adds IP version checks for other IP fields.
The unit tests were calling a nonexistent assert_called() on the
mocks. This patch fixes the problem by using the correct assert for
checking that the mocked method was invoked.
Note: This patch does not fix the error in test_call_driver() because a
separate bug fix revises the test.
When attempting to create a flat network on a physical_network on
which a flat network is already allocated, the openvswitch and
linuxbridge plugins return a FlatNetworkInUse exception rather than a
VlanIdInUse exception referencing VLAN -1.
Brian Waldon [Thu, 6 Sep 2012 17:43:05 +0000 (10:43 -0700)]
Lower webob dep from v1.2.0 to v1.0.8
All other OpenStack projects expect webob v1.0.8 yet Quantum expects
v1.2.0. This discrepancy causes problems for certain projects that
can't actually support v1.2.0 yet. This patch aligns the required
version with that which the other OpenStack projects expect.
- adds admin-writable, world-readable router:external attribute to
the network object if L3 extension is loaded.
- prevents floating ips from being created unless network is external
- shortens L3 extensions alias from 'os-quantum-router' to 'router' to
make attribute extensions more readable.
WIP:
- Need to add policy logic so non-admin users can always see external
networks without requiring that these networks are shared (since VMs can
always create ports on shared networks, but provider may want to have
externals networks that VMs cannot directly plug into.
Random clean-up:
- prevent delete_network in plugins from implying it returns something
- modify extensions.py so that exceptions during calls to
get_extended_resources() will actually be logged if unexpected.
- unset executable bit on test_iptables_manager.py to make sure tox
actually runs it.
The original bug occurred because the set of subnet cidrs changed
without a restart of dnsmasq. As a result, dnsmasq would not respond
with offers for fixed_ips assigned in the unknown cidr ranges even when
the underlying host file had properly updated.
This patch addresses the bug by restarting dnsmasq when the set of
subnet cidrs changes. When the set does not change, it will reload the
options and allocations.
This patch adds specific filters for the ip command. The first filter
matches ip with any subcomand except netns exec. The second filter
matches "ip netns exec" and then relies on the caller (match_filter) to
verify the sub-command against the other filters. Matching the
subcommand separately allows for a single set of filter definitions that
work with and without namespaces.
Adds namespace clean up utility called quantum-netns-cleanup which can be used
to remove old namespaces.
The --force option can be used to remove all Quantum namespaces and any
remaining devices. The force option is should not be run on a live Quantum
systems. It is intended for cleaning up devstack a after running
unstack.sh (ideally this will be added to unstack.sh in the future).
Example cmd line when cleaning up a devstack install:
quantum-netns-cleanup --config-file /etc/quantum/quantum.conf \
--config-file /etc/quantum/dhcp_agent.ini --force
This patch also ensures that the local vlan mapping is updated correctly.
This was problematic in the event that the OVS agent would start and a port
was in administrative state down.
The fix follows the patch that was done on the DHCP agent to enable
the user to configure the usage of namespaces. In the event that
namspaces are disabled the agent is limited to running only one
router. The agent needs to define the router_id that is supported.
The process in this case is:
1. create router
2. start agent with router id
Previously, some netns commands were executed in the context of the
namespace defined in the wrapper. These commands should be be executed in
the root namespace for the most reliable results.
This is the 3rd and final patch for this bug. This patch alters ip allocation
recycling to honor lease expiration. Allocations that are in the
expiration wait state have null port_ids.
Bob Kukura [Fri, 31 Aug 2012 04:12:41 +0000 (00:12 -0400)]
expose openvswitch GRE tunnel_id via provider API
The provider:vlan_id extended attribute is renamed to
provider:segmentation_id, and the openvswitch plugin returns the
tunnel_id of GRE networks as this attribute.
- Rename provider:vlan_id to provider:segmentation_id.
- Use consts for providernet extension's attribute names
- Remove validation clause from provider:segmentation_id resource attribute map data.
- Validate provider:segmentation_id in linuxbridge and openvswitch plugins.
- Rename physical_id to segmentation_id in the openvswitch schema, plugin, and agent.
The bug noticed that an admin user could delete a port that stored
the underlying IP allocation for a floating IP. This patch prevents
the direction deletion of ports via the API for ports that are used as
router interfaces, router gateways, of for floating IPs.
Add a unit test to check such an invalid delete, and also updates
unit tests to avoid them tripping over the new checks.
siyingchun [Wed, 29 Aug 2012 01:22:26 +0000 (09:22 +0800)]
Modified code PEP8 warning.
*Find more than one space after keywords, then eat one.
*Make sure every continuation line is aligned with the first character after
the top parenthesis in the top line.
Bob Kukura [Wed, 15 Aug 2012 06:43:17 +0000 (02:43 -0400)]
Implementation of 2nd phase of provider extension for openswitch
Enhances openvswitch plugin to support flat networks and VLANs on
multiple physical networks via the provider extension. Implements
blueprint provider-networks.
See http://wiki.openstack.org/ConfigureOpenvswitch for
configuration and usage details.
A devstack patch to support the updated openvswitch configuration
variables is at https://review.openstack.org/#/c/11418/.
Summary: Copy/paste the essential parts of the rootwrap
mechanism from nova/cinder into quantum. This includes
the core changes to filter.py and wrapper.py which deal
with loading filters from files pointed to by
rootwrap.conf
Detailed changes:
Transliterate the old rootwrap/*-agent.py files to
new format, and put the results in etc/quantum/rootwrap.d
Delete the *-agent.py files.
Add conf to point to etc/quantum/rootwrap.d
Add a unit test cribbed from nova to exercise the filter
mechanism
Add a unit test to exercise the actual filtered execution
Note that as written, this patch does not set the default
execute mechanism (in the agent .ini files) to rootwrap,
leaves it as sudo. That can be done in a followon
change, or in distro specific packaging.
Note also that there is still work to do around finishing
and testing the filter specs themselves. We've decided
that that is out of scope for this patch.
Port has no 'host_routes' attribute according to the latest V2 API
specification. So, policy check for 'host_routes' is not need any
more, just remove it in this patch.
Currently, the cisco nexus sub-plugin doesn’t handle the network admin state parameter
when it’s updated. The fix would enable the sub-plugin to handle an update of the admin
state of the network. In update_network of the nexus sub-plugin, vlan corresponding to that network
is added/removed from the nexus interfaces based on the network state. Unit tests are added as well.
This patch fixes a bug in delete_network and delete_subnet where the InUse
exception was being thrown for resources owned by the network and not
the tenant. This patch force deletes network resources if they are the
only blocker to deleting the parent resource.
Yusuke Muraoka [Tue, 28 Aug 2012 09:59:42 +0000 (09:59 +0000)]
Plugin aware extensions should also be reset at each test setup
PluginAwareExtensionManager caches extension according plugin.
At each db plugin test setup, testing plugin and router are newly
created.
However, the extension manager held the extensions for first time
loaded plugin. Because of their cache.
So if a plugin conditional extension exists, it could not be loaded by
testing order.
In the event that an IP address and gateway are defined on an interface that is
used in a flat network, then the interface details will be copied to the
bridge when it is created.
If the network is deleted then the IP addresses are returned to the interface.
On account of the new requirement to run plugin-specific tests also
along with the Quantum tests, changes are being made to
incorporate the Cisco plugin unit tests into the Quantum unit test
suite. Earlier unit tests have been moved and modified.
the fact that these plugins ever cleared this field is probably just a
misunderstanding of how the field is supposed to be used, as I don't think
it ever makes sense for the L2 plugin logic to change this field.