This patch adds an option for always synchronizing operational status
on a show operation; regardless of the synchronization thread, when
this option is enabled, the resource status is always fetched from
the backend.
The patch also fixes an issue observed when running test_nvp_sync
alone.
ZhiQiang Fan [Wed, 18 Sep 2013 17:53:44 +0000 (01:53 +0800)]
Ensure router exists when auto_schedule_routers
Currently, the auto_schedule_routers() accepts parameter router_ids,
which may contain invalid router ids, since we've already filtered
them via plugin.get_routers(), we can directly use that safe object.
Properly synchronize status for ports deleted from backend
Ensure that the status for a port is properly synchronized even
when the port itself does not exist anymore in the backend, avoiding
raising exceptions due to missing results in the NVP query.
This patch also adjusts a comment and improves exception handling
in _nvp_get_port_id
Ensure nullable=False for netid in packetfilters table
From the initial commit of NEC plugin, network_id of packetfilters
table is nullable=False, but in folsom_initial db migration script
nullable is set to True. This commit ensure nullable=False for
network_id in packetfilters table in any migration revision.
Cascade on delete from ports.id to packetfitlers.in_port is added
to ensure packet filter entries associated with a port.
Also joined query of packetfilter with port query is added
to avoid additional packetfilter query by port_id.
This fix ports the Cisco Nexus sub-plugin unit tests
(neutron/tests/unit/cisco/test_nexus_plugin.py) to the Cisco ML2 mechanism
driver. The new test script will be
neutron/tests/unit/ml2/drivers/test_cisco_nexus.py.
Test cases which will be excluded from this port:
- Test cases involving provider networks.
- Test cases involving add/remove router networks
since these features are not currently supported in the Cisco ML2
mechanism driver.
The reference implementation of the FWaaS iptables
agent/driver supports only one firewall per tenant
in Havana release. However, the FWaaS plugin will
let you create more than one firewall. This is
being fixed in this patch to not allow creating
the second firewall if a firewall already exists
for the tenant.
Matt Riedemann [Fri, 20 Sep 2013 15:47:25 +0000 (08:47 -0700)]
Handle long integer conversion in NEC portinfo validation tests
There are a couple of tests for NEC portinfo validation that pass an id
which gets converted to a base-16 integer and then that gets converted
to a hex string. The problem is the integer conversion can make it a
long integer and then the hex built-in appends 'L' to the string, and
the tests do not account for that. This patch handles that case.
This fix ports the Cisco Nexus database and network database
unit tests to the Cisco ML2 mechanism driver UT.
The existing test scripts which are ported:
neutron/tests/unit/cisco/test_nexus_db.py
neutron/tests/unit/cisco/test_network_db.py
The new test scripts are:
neutron/tests/unit/ml2/drivers/test_cisco_nexus_db.py
neutron/tests/unit/ml2/drivers/test_cisco_network_db.py
Note that the QoS database related tests in
test_network_db.py are not ported because QoS is
not currently supported in the Cisco ML2
mechanism driver.
Ensure names are truncated to accommodate NVP limit
Switches created through Advanced Plugin should have
their name truncated as well. To this aim, move things
around to avoid awkward imports or code duplications
Kaiwei Fan [Mon, 16 Sep 2013 22:02:34 +0000 (15:02 -0700)]
Fix for status always in PENDING_CREATE for Edge service router
The root cause is when deployment finished, we only update router status to
active if the status is in pending create. The problem happens when the
background sync thread update router status to active, so the status update
for vcns_router_binding table is skipped. We fixed this by seperating
checking and updating status for router and binding table.
Also fixed an issue where Edge is not deleted if neutron service is
restarted. The root cause is when neutron service restarts, the cache for
router type is empty. And because we delete the router from db before
we delete Edge, we're not able to locate the router from db to determine
the router type. The fix is to use binding table to determine the router
type.
Also piggyback a missing attribute for updating Edge interface. It must have
been removed by accident when resolving conflict during service plugin merge.
Luis A. Garcia [Wed, 18 Sep 2013 23:11:06 +0000 (23:11 +0000)]
Sync gettextutils from oslo
Some Messages, such as those created from Invalid exceptions, use a
Message within a Message, and we were only translating the base Message
but not the Message substitution within.
Due to a recent change, reodering of rules within the
same policy was failing. This is fixed by checking if
the rules belong to the same policy we allow reordering.
There was also a missing call to reorder due to which
the position number on the rules was not reflected correctly
after the reordering. This is also fixed.
port binding feature of ML2 plugin registers a callback function with
db_base_plugin_v2.NeutronDbPluginV2, which is invoked during a query of
port DB. This function is registered by name instead by refefence. This
causes wrong context to be passed to the function upon invocation, which
causes the exception. If this query is made during neutron
initilization, Neutron service will fail to start.
This fix changes the registration from function name to function
pointer
Fixes two comment lines regarding when bind_port
is called. The correct comment should indicate that
bind_port is called prior to "create_port_precommit or
update_port_precommit" rather than
"create_network_precommit or update_network_precommit".
Kevin Benton [Tue, 17 Sep 2013 20:22:32 +0000 (13:22 -0700)]
BigSwitch plugin: passes context to all update_network calls
There were a few calls to update the network on the backend
that were not having the context passed to them so they were
incorrectly using the admin context. This patch corrects that
by passing the context to all network update calls. It also
disallows calls to _send_update_network that don't provide
the context because there is not a use case for that condition.