Drop and recreate FK if adding new PK to routerl3bindings

Since MySQL 5.6 FK columns cannot be altered. As a workaround we can
drop the FK before ALTER COLUMN and then recreate it.

Change-Id: Icd1b3075cf29a6b0c477a4ddea2e6ebee91baef8
Closes-Bug: 1384555
(cherry picked from commit b5f1cc48b877caaebc944154d56a8bb4060aa9b0)
Fix context.elevated

The current version of elevated method sets for the original context
the admin role too. This change fix this.

Added unittest.

Closes-bug: #1386932

Change-Id: Ife881112efa151e53bfa4b7af35643dcf2d1114f
(cherry picked from commit 98fae47ad1b9b72e41d444ce6f96cf5f2a3b6f0c)
linuxbridge-agent: make vxlan unicast check more efficent

A list with the full range of vxlan VNIs (1 to 2**24) was using
over 300MB of memory. This patch uses xrange instead of range.

Closes-Bug: #1393362
Change-Id: I21ccab758e7911712690fd5e732f64361e809264
(cherry picked from commit 0bf69ad80fb77773e767e116357cf6e1666b3f5d)
Convert all incoming protocol numbers to string

PostgreSQL is more sensitive for types than MySQL when it selects
something from columns in database. So it fails when it tries to
select from string field comparing with integer value.

Added unit test to verify conversion of protocol numbers to
strings.

Closes-bug:#1381379

(cherry picked from commit bc34f26302faea116be7e61051c32f8787530836)

Conflicts:
	neutron/tests/unit/test_extension_security_group.py

Change-Id: I0a29595403a07c66888871088d5549705a097f68
Fix metadata proxy start problem for v6-v4 network

Commit 1b66e11b5d8c0b3de0610ca02c3e10b6f64ae375 introduces
a new problem that metadata proxy will not be started when
an isolated network contains ipv6 subnet with dhcp enabled
and a ipv4 subnet.

This fix separates the checks to enable dhcp and enable metadata
so metadata proxy can be started if there is ipv4 subnet exists
in the network with metadata enabled.

Change-Id: If26806083db225e9ab30d75fa6c728ce99a7cafe
Closes-Bug: 1392564
(cherry picked from commit 4c128c351589ef9f2fc1e084c655a97bdbbda7ce)
Merge "linuxbridge-agent: make vxlan unicast check more efficent" into stable/juno
Merge "Fix context.elevated" into stable/juno
Merge "Drop and recreate FK if adding new PK to routerl3bindings" into stable/juno
Merge "Fix metadata proxy start problem for v6-v4 network" into stable/juno