Open stable/havana

Change-Id: I840bc75d4eadbaea7f3d9cd8b8ae85a4e9d6843f
Refactor configuring of floating ips on a router

This approach to configuring floating ips is stateless and idempotent.
This allows it to handle corner cases, such as reusing a floating ip
address with a different floating ip id in a way that is easier to
understand.

The concept is to wipe the floating ips clean and rebuild them each
time with the following optimizations.  To avoid bad performance in
manipulating iptables, it is called in the context of a call to
defer_apply_on.  To avoid a disruption in network flow a set
difference is use to determine the set of addresses that no longer
belong on the inteface rather than removing them all blindly.

Change-Id: I0cfb58d487b1925e0a0db2a701c5ea3c56a0b2b5
Fixes: Bug #1209011
Removes unused nvp plugin config param

nvp_cluster_uuid is no longer used; it was missed
during the configuration file tweaks that was done
during Havana.

Closes-bug: #1251086
(cherry-picked from commit  Id6dd684833c99453cd97d88584be04d99fd21550)

Change-Id: Id6dd684833c99453cd97d88584be04d99fd21550
Tune up report and downtime intervals for l2 agent

If the neutron server erroneously thinks that the l2 agent is down
it will fail to bind a port, which can lead to VM's spawn errors.
However, the issue is only transient because the agent effectively
is only 'late' in reporting back.

Best solution would be an alpha-count algorithm (so that we can detect
persistent failures more reliably), but for now let's be more tolerant
assuming that the agent is down by waiting at least twice the report
interval plus a tiny teeny bit.

(cherry picked from commit 291048aba2fcaec8afee3011fb4c12c6ca0ebbba)

Close-bug: #1244255

Change-Id: I544135ce1f6b7eaefb34ac44af8f5844d92ddd95
Fix DB integrity issues when using postgres

The IntegrityError faced on network deletion that
spooks Tempest tests is most likely caused by the
fact that the ml2 plugin does a dirty read. By
adding a 'select for update' we should be able to
address the issue once and for all.

Also, there's a chance that the dhcp port gets
reallocated while we are deleting the network. To
this aim, catch the integrity error and attempt
to recover from it.

This patch also removes the handling of errors
on concurrent reads that can no longer occur when
deleting the network.

(Hopefully) Closes-bug: #1239637

PS: This fix may be relevant for bugs #1243726 and #1246737

Change-Id: Iefae7fc8a903cc35d8bf80fc4cee533b7f64032c
(cherry picked from commit 54d79acaab50993f08b50f21019f82f17d38caa3)
Lower severity of log trace for DB integrity error

LOG.exception is not appropriate, since a concurrent
port creation can occur and it has been dealt with
in the except block.

This avoids spooking users who are on the hunt for
real bugs.

Supports fix for 1239637

Change-Id: I9489702ee63db0b004fe41195fa4727af261d514
(cherry picked from commit 4c6906498a5ef0f11ada3ff2224e995f6b3062d8)
Linux device name can have '@' or ':' characters

It's possible to set '@' or ':' character in Linux device name. But
Neutron IP lib doesn't handle correctly these names.

To distinguish VLAN devices from others devices with '@' in their name,
the details option in iproute2 is used.

Change-Id: I7ed24ec00f481207d97bdef052f86388f24d9b21
Closes-Bug: #1245799
(cherry picked from commit 34f30a1d16d81be86a117690ccc5bdfc5bdd0659)
Fix OVS agent reclaims local VLAN

If a port disappears on an OVS agent, the port is removed of the lvm
vif_ports list. And if it's the last port of the network on this agent,
the network local VLAN is reclaim.

Change-Id: I07e03107eb86a84eeb8e4d06f27a1d2fbd7cea57
Closes-Bug: #1252284
(cherry picked from commit a5d996e381bd342f0204fcd99e8548cf28b20e92)
Ensure NVP API connection port is always an integer

Convert the 'port' part of a NVP endpoint to int before passing
it to the NVP API client.

Change-Id: I15137d943ab950cb5cc80d7af2971bce3ac1a265
Closes-Bug: #1255519
Support uncompressed ipv6 address and abbreviated ipv4 address

Now neutron supports zero-compressed ipv6 address like
'2001:db8::10:10:10:0/120' and unabbreviated ipv4 address
like '10.0.0.0/24'.
This path will make neutron also support uncompressed ipv6
address and abbreviated ipv4 address. for example:
1, uncompressed ipv6 address like 'fe80:0:0:0:0:0:0:0/128'
2, ipv6 address with multiple consecutive zero like
   '2001:0db8:0:0:1::1/128' or '2001::0:1:0:0:1100/120'
3, abbreviated ipv4 address like '10/24'

Change-Id: I755e38ea11c139e15488ec60e7d5682a244ab114
Closes-Bug: #1240790
(cherry picked from commit d1b783fd673448381445dce82e9160ba2f715a7c)
Mocking ryu plugin notifier in ryu plugin test

Previously RPC notifier is not mocked in ryu plugin test and the
plugin tries to send RPC notifications. It may interact with
impl_fake RPC set up in previous tests by other plugin
and sometimes leads to unexpected ovs-vsctl invoking.

Change-Id: I11714a160faa4d3ded7f312c39afba0b426ccd8a
Closes-Bug: #1255421
(cherry picked from commit dc2f567df3972465797d4d5b492ac1c243737cfe)
Sync openstack.common.local from oslo

`local` has a broken TLS symbol - strong_store, fixed in oslo some time ago in
Ib544be1485823f6c619312fdee5a04031f48bbb4. All direct and indirect
(lockutils and rpc) usages of strong_store might be potentially affected.
Original change to Nova: If4dd973acc23921dbc2bc69bb76225deb2802dad

Closes-Bug: #1254046
Change-Id: I6e5efa156c9a905a979a469244cd483723e6b1e3
(cherry picked from commit e63d30fc6bd4d89b4d394fcfeabb592cbe26881d)
Add vpnaas and debug filters to setup.cfg

Change-Id: I44f7e4a44276a386b6e4d8bfb8370eb103787a21
Closes-Bug: 1257523
(cherry picked from commit af6c2bbfe6b5694090f4f33d75663024d1b6e066)
Fix MeteringLabel model to not clear router's tenant id on deletion

foreign_keys parameter of orm.relationship should point to local columns.
Currently for MeteringLabel it points to Router.tenant_id column which causes
routers tenant_id clearing on label deletion.

Closes-Bug: #1249188
(cherry picked from commit d1220a3c22fccc1d86eaafeebe7ef9c074d4fcb9)
Change-Id: Iccc0daf4f6edd537fd7f9e4b2fc4be094543ca5d
Sync rpc fix from oslo-incubator

Sync the following fixes from oslo-incubator:

e227c0e Properly reconnect subscribing clients when QPID broker restarts
ef406a2 Create a shared queue for QPID topic consumers

Closes-bug: #1251757
Closes-bug: #1257293
Change-Id: I286edf6bc4a677aa61f60da785802c19878c79c7
Add fwaas_driver.ini to setup.cfg

Change-Id: Ie8157c0df343fb1009e7bc5b3ed2f2d4b0d0afec
Closes-Bug: 1258585
(cherry picked from commit daf0d68f9fc1f878ae29061dc43c19fd3e4950ef)
Add X-Tenant-ID to metadata request

Previously, one could update a port's device_id to be that of
another tenant's instance_id and then be able to retrieve that
instance's metadata. In order to prevent this X-Tenant-ID is now
passed in the metadata request to nova and nova then checks that
X-Tenant-ID also matches the tenant_id for the instance against it's
database to ensure it's not being spoofed.

DocImpact - When upgrading OpenStack nova and neturon, neutron
            should be updated first (and neutron-metadata-agent
            restarted before nova is upgraded) in order to minimize
            downtime. This is because there is also a patch to nova
            which has checks X-Tenant-ID against it's database
            therefore neutron-metadata-agent needs to pass that
            before nova is upgraded for metadata to work.

Change-Id: I2b8fa2f561a7f2914608e68133abf15efa95015a
Closes-Bug: #1235450
Updated from global requirements

Change-Id: I577b50bc1d7ea55c4d4779d3ac55964bfb022aa9
Fix unable to add allow all IPv4/6 security group rule

Previously, if one tried to add a rule to allow all ingress ipv4 neutron
would respond that the rule was already part of the security group.
This happened as the filter for querying existing rules uses a wildcard for
remote_group_id thus returning a false match. This patch addresses
this issue.

Change-Id: I0320013a3869d25fb424995354721929465d2848
Closes-bug: #1252806
(cherry picked from commit 9335ffd7c3eaad0d66d7d19e7760ae12476a5ea2)
Bump stable/havana next version to 2013.2.2

Change-Id: I3a7170180717bd62fce4cbc2c3a9107187f89fb1