L3 agent fetches the external network id once

Rather than fetching the id of the external network each time that
_process_routers is called, get it once and remember it.  If the agent
is ever requested to connect to a different ext-net then it will fetch
the current ext-net to double check for the unlikely event that the
ext-net has changed.  If it has then it will remember the new ext-net.

This is only applicable in the case where there is only one ext-net
that has not been configured explicitly in the config file.  That was
the only case that would cause an RPC message in the first place.

Change-Id: I40bbbf6233131ea5d40122ef9495fd3cb7dc823a
Closes-Bug: #1269567
Reset the policy after loading extensions

The loading of extensions might impact how rules are interpreted in the
policies; for instance, the external-net extension specifies how to
convert the router:external field of a network (to a boolean). So we
need to make sure that the policy is recreated afterwards.

We also need to fix a unit test that assumes that the policy is loaded.

Change-Id: Ifde13323b1435fc84c6cb24ab6a71de5d67f6b9f
Closes-Bug: #1280738
ML2 mechanism driver access to binding details

The following properties are added to the PortContext object passed to
ML2 mechanism drivers for port operations:

* bound_driver - name of current bound driver
* original_bound_driver - name previously bound driver in an update
* original_bound_segment - network segment used in previous binding

Some issues with the existing ML2 port binding unit tests were also
fixed.

The remainder of the fix for bug 1276395, making these binding details
available to mechanism drivers when a port is deleted, will be
addressed as part of the fix for bug 1276391.

Partial-Bug: #1276395
Change-Id: I9ecff4a4e044920ed2dde709c89aeb9bc773220d
Developer documentation

* Turns TESTING into a rst file, that we include in the developer
  documentation, for instructions on how to run the unit tests.
* Link to a Vagrant project that sets up Neutron inside a VM.
* Adds a section for how to debug with Nose
* Add new section for Neutron Internals
* Neutron L2 Agent documentation - currently only OVS
* Make the Security Group API extension an example of how an API
  extension is implemented

Implements bp developer-documentation

Change-Id: I9b452abc9da3b1a41ae65cff727967de0eab12fe
Fix DetachedInstanceError for Agent instance

The stacktrace observed seems to hint to a
situation where a session is not properly
rolled back when duplicate agent entries are
found.

Since it is ok to deal with duplicates, the
addition of agents to the DB must be done
one by one, otherwise we go against the
ATOMICITY property of a transaction of all
or none. It's either that or I am barking at
the wrong tree.

This patch also added UT to cover affected
code.

Closes-bug: 1282421
Related-bug: 1282253

Change-Id: Ic5f77808cc10f885d67f5a9cf3b3836283692850
ovs-agent: use hexadecimal IP address in tunnel port name

The remote IP address is used to form the tunnel port name when
the ovs-agent is used with the ML2 plugin. With some OVS/Linux
combinations there is a 15 character limit on port names, so a
name like 'gre-192.168.10.10' does not work. This fix uses the
shorter hexadecimal representation of the IP address instead.

Change-Id: I58caf54219130159525b5a6492eaa451062c2ff5
Closes-Bug: 1281098
N1kv: Fixes fields argument not None

N1kv plugin includes 'fields' in call to get_<resource> function in
superclass. This can trigger errors if other fields are used in the
subsequent processing in the N1kv plugin's own get_<resource>
function.

Change-Id: I63687a830579a178c6daaa2b8f71bef7eb53d584
Closes-bug: #1285289
NSX: make sync backend run more often

This patch bumps the state_sync_interval from 120 seconds to 10 seconds
so that resource's operation status are synced to the db quicker. This cuts
the amount of time that tempest takes to run by half.

Closes-bug: 1285338
Co-Authored-By: Salvatore Orlando <salv.orlando@gmail.com>
Change-Id: I494a6f95c2321befc3c0bfedc719e18a1826d9d5
Remove unused method update_fixed_ip_lease_expiration

This should have been log removed here:
	Ifcb4f093c92904ceb896438987d53e692eb7fb26

Change-Id: I9395fea531365b82a0cd16f29d6392199e2d9c22
Closes-bug: #1287407
Adds multiple RPC worker processes to neutron server

blueprint multiple-rpc-workers

Co-Authored-By: Terry Wilson<twilson@redhat.com>
Change-Id: I51f2a52add6c11af905e6f1e6e45d31731ebbb5d
Refactor netns.execute so that it is not necessary to check namespace

I saw some code in a couple of reviews today that check whether a
namespace is set and run it under "ip netns exec ..." if it is.
Otherwise, it runs the command without it in the default namespace.

Change-Id: I55e8f4f3523ec7a7c5a6f082addf918952a05741
Closes-Bug: #1287524
NSX: passing wrong security_group id mapping to nsx backend

When the async secgroup work was added the update_port() code was not changed
to pass in the nsx security_group uuids. This patch fixes that so that the
nsx uuids are passed in instead of neutron.

Closes-bug: #1287419

Change-Id: I1a075564f2548764de15b85b2970b5f360412eb2
Implementaion of Mechanism driver for
Brocade VDX cluster of switches

Change-Id: Ic1649f7cee73a41f286e12d8ba6ca30be6261cfe
Implements: blueprint brocade-ml2-mechanism-driver
Fix race condition in update_floatingip_statuses

If a floatingip is deleted before update_floatingip_statuses() is processed
FloatingIPNotFound is raised.

Change-Id: Idf03fda75ccd147673169c24e79921ca6d8fe754
Closes-bug: #1288036
Do fip_status migration only for l3-capable plugins

The migration was initially performed for all plugins, causing
failures for plugins for which the initial L3 migration was
not performed.

Change-Id: I4a48a13202a4125f032a3e80aa567f7979d2c335
Closes-Bug: 1287630
Replaces network:* strings by constants

This patch replaces all occurences of the strings
prefixed by network:* by their constant equivalent.

Closes-bug: #1270863
Change-Id: I149cc0ab7bde08ea83057e6c0697f668edbe29db
Add OpenDaylight ML2 MechanismDriver

This commit adds support for OpenDaylight as an ML2 MechanismDriver. The
ODL MechanismDriver does not need an agent since ODL itself handles
programming bridges, tunnels, and ports on the host.

Implements bp ml2-opendaylight-mechanism-driver

Change-Id: Ic1612cd3e8efd39e74a7ed8cff28e91b1f388971
Merge "Adds multiple RPC worker processes to neutron server"
Merge "NSX: make sync backend run more often"
Merge "L3 agent fetches the external network id once"