l2-pop : removing a TODO for the delete port use case

since this commit : d9bcd597c67900472709cd11604afe1616e0af4e
port info are accessible during the delete_post_commit

Change-Id: I2c560b78c59fc178e668ae73fb994f1ef4b68dc4
ofagent: Fix an argument mismatch bug in commit 9d13ea88

recently merged commit 9d13ea884bff749b3975acb5eb5630e5aca4a665
had an argument mismatch bug which causes the following crash.

    TypeError: _get_ports() takes exactly 2 arguments (1 given)

this commit fixes it.

Closes-Bug: #1336175
Change-Id: I46bb1fc1aebf06274bb226014e4a9bc5a83f98ac
Add CONTRIBUTING.rst

There is no CONTRIBUTING.rst file, the patch will add it.

Change-Id: Ifcdc30b47b5fb668bbca2e974d8cff63a938addb
Refactor 'if false do nothing' logic in l3 scheduler db

Change-Id: I67983bb1115857ab11e3269fcbe1b20c85c93dbb
Added support for NOS version 4.1.0, 5.0.0 and greater

NETCONF temaplates for NOS version greater than 4.1.0 are slightly
different (argh). An init time check of the NOS version is done
to enable selection of the correct NETCONF templates.

Change-Id: I01e82ad402fbbb25d92a99a3325ca2608dd514cb
Closes-bug: #1332719
Add BSN plugin to agent migration script

Adds the Big Switch plugin to the migration script that creates
the agents table. A recent commit (d3be7b040eaa61a4d0ac617026cf5c9132d3831e)
added it to the agent tables but it missed this one so an error was thrown
during migration when it reached a table that depended on the agents table.

Closes-Bug: #1340405
Change-Id: I90a164a1b632c3794a7f7607f3f1da8f7d7b15db
Change all occurences of no_delete to do_delete

Previously, ports, networks and subnets had a do_delete=True
parameter. By default, these resources were deleted at the
end of the context manager scope. All other resources used
a different semantic: no_delete=False.

This caused confusing situations such as:
with self.subnet(network, do_delete=False) as subnet:
    with self.security_group(no_delete=True) as sg:
        pass

Now all resources use the same do_delete semantic.

Closes-Bug: #1336196
Change-Id: I4627481813f714819efe85831e2a55975ea71ed4
Security groups extension for PLUMgrid plugin

This patch includes immplementation of security groups
extension in PLUMgrid plugin.

APIs include CRUD operations for security groups
and security group rules.

Added unit tests.

Implements: blueprint plumgrid-plugin-security-groups
Change-Id: I23fea3fe6c3abbe310e883e00706b93863db3bfb
Add -s option for neutron metering rules

While adding iptables rule, cidr is added as destination for both ingress
and egress directions. Modified code to add -s for egress and -d for ingress.

Closes-bug: 1310589

Change-Id: Id9ca10855e6527d4bec689f8f9bcd6f681221954
ofagent: Handle device name prefixes other than "tap"

This fixes regressions in commit 9d13ea884bff749b3975acb5eb5630e5aca4a665.

Handle device name prefixes other than "tap".
For example, nova hybrid interface driver uses "qvo" prefix.

Also, ignore non neutron ports correctly.  For example, veth pairs
used to connect physical bridges.

Closes-Bug: #1341465
Change-Id: I1d71c8a2cf8c2f71f0dbcfb54c9b347e24c03562
Freeze models for healing migration

Take a snapshot of all models from the code base at the time when the
healing migration merges. The healing migration needs this frozen view
of the models to be available (even as the models change in the future)
to compare with the current DB schema. The healing migration will use
this comparison to heal the schema.

partially implement bp: db-migration-refactor

Change-Id: I438147c7961b1ecad47f6146cc7fc9396aee7bc5
ML2: Bind ports outside transactions

The ML2 plugin now calls the bind_port() operation on the registered
mechanism drivers outside of any enclosing DB transaction. Ports are
created or updated in one transaction, then a binding is established
if possible, and finally a second transaction commits the binding
result.

With [re]binding moved outside the DB transaction that triggered it,
it is now possible that multiple threads or processes will
concurrently try to bind the same port, or that the port will be
updated between transactions. Concurrent attempts to bind the same
port are allowed to proceed, which results are used is resolved in the
second transaction, and binding is retried if necessary.

Improvements to the Cisco Nexus driver and unit tests from Rich Curran
needed due to the binding changes are also included.

Closes-Bug: 1276391
Closes-Bug: 1335226
Change-Id: I65dafc330d6e812dad0667d2383858504d0ba299
Merge "Refactor 'if false do nothing' logic in l3 scheduler db"
Merge "Add -s option for neutron metering rules"
Send network name and uuid to subnet create

Added the network segment name and uuid parameters to the infomation sent to
Cisco N1kV during subnet creation to allow for proper association of the
subnet and network segment.

Change-Id: I375d49ec43f79360189ecf5de0583873b8039db9
Closes-Bug: 1332713
Fixed audit notifications for l3-agent-router ops

l3-agent-router-add and l3-agent-router-remove do not
generate audit notifications which are used for security
compliance.
CRUD operations of core network resources are
handled by neutron/api/v2/base.py. In base.py, each of
create(), update(), delete() methods makes calls to
oslo.messaging.Notifier.info() to generate these notifications.
In the proposed fix, it is fixed in a similar fashion in
extensions/l3agentscheduler.py inside create() and delete()
methods by introducing info() method calls inside them.

Change-Id: I1354e51e4af24eda128c042926765683018b320b
Closes-Bug: 1317000
Database healing migration

Add script that will add all tables for all plugins and make db schema
unconditional.

partially implement bp: db-migration-refactor

Closes-bug: #1277379
Closes-bug: #1304741
Closes-bug: #1298456
Closes-bug: #1298461
Closes-bug: #1239974
Closes-bug: #1336177
Closes-bug: #1337185

Change-Id: Ie49088a74bc5a87466f46989ce14d935e27567d1
L3 agent prefers RPC messages over full sync

When the L3 agent starts up and runs the sync task it doesn't process
any incoming RPC events until the sync task is complete.

This change combines the work from _rpc_loop and _sync_routers_task in
to a single loop called _process_routers_loop.  This loop spawns
threads that pull from a priority queue.  The queue ensures that RPC
messages are handled before _process_routers_loop.  The latter is
generally maintenance tasks triggered by the agent rather than user
triggered tasks.

Synchronization between RPC and sync routers loops is no longer
necessary since they both feed in to a single queue.  There were
places where it was necessary to reorder some things to allow for the
lack of synchronization.  For example, it is necessary to list
namespaces before fetching the full list of routers to ensure that it
doesn't delete a new namespace that gets created after listing
namespaces.  The lack of the need for synchronization between loops is
probably the main strength of this patch.

With multiple worker threads, need to handle the case where an RPC
message came in while a thread was working on a router.  Another
thread should not handle the same router that is already in progress.
Adds a mechanism to signal to the working thread that an update came
in for the router it is working on.  The original thread will repeat
processing the router when it is finished to get the update.
Multiple rapid updates to the same router will be consolidated.
Essentially, there is still synchronization of work for a given router
but not between routers.  Much better than before.

blueprint l3-agent-responsiveness
Closes-Bug: #1289066
Change-Id: I39afe86c66f864d71adf865d7bd1c9db35511505
Merge "ML2: Bind ports outside transactions"
Merge "Freeze models for healing migration"