Add unit tests covering single operations to ODL

This commit adds the remaining test cases (create and update
operations) to fully cover sync_single_resource. It also defines the
filter_* methods as static or class methods and removes their duplicate
arguments.

Change-Id: I6b6153ea577bd685576690559b1c389490ee525d
Closes-Bug: #1325184
Work toward Python 3.4 support and testing

Change-Id: Ieae7819e0489ae19b7fcfb63497e06527c918b5c
Supply missing cisco_cfg_agent.ini file

cisco_cfg_agent.ini file was missed in the initial commit and
caused neutron startup issues. This patch supplies the proper
ini file and adds it back to neutron setup.cfg.
Also the introduced config options are put in a specific group
instead of default as was in the initial commit.

Change-Id: I74b3b77fe6e196524809580f522f91f3b62f5ba7
Closes-bug: #1351466
Removed kombu from requirements

Since we've replaced oslo-incubator RPC layer with oslo.messaging, we
don't ship any code that uses kombu.

Change-Id: Ia8a74f1326ecd98c47cbe447f04d475bf61e19d3
Pythonified sanity_check.all_tests_passed

Change-Id: I48986344b7af507e2526d4e8bd1b03277f974972
Added TAP_DEVICE_PREFIX info to common/constants

Change-Id: Ia84629732490585164237ca4f7d1db90bde9fbf2
Closes-Bug: 1361573
Properly handle empty before/after notifications in l2pop code

Change-Id: I8644bb7cc2afb3b181397a478f96927990c0a4ca
Closes-Bug: #1367881
ofagent: Fix a possible crash in arp responder

Be careful for exceptions when feeding packet-in data,
which is generated by tenant VMs and thus can not be trusted,
to Ryu packet library.

Closes-Bug: #1365255
Change-Id: Ia8bacfb55def563a1b23a47709ae72bd4fce0fce
Cisco N1kv: Remove vmnetwork delete REST call on last port delete

Remove the vm network delete call to the VSM on final port call and
ensure that vm network is deleted from the database when the port count
becomes 0.

Change-Id: I6c08a099adfce2fdba8eefec6aadeb68a780ac37
Closes-Bug: 1373547
Rename workers to api_workers and simplify code

Refactor a few ugly aspects of the multiple API worker patch to make
way for multiple rpc workers.  This came up as I was trying to add
multiple RPC workers using similar patterns and remembering that some
things were left in a rather awkward state.

Change-Id: I549db67af4af6a2df80e12cf233109dda5213c47
ofagent: Ignore unknown l2pop entry removals

l2pop can send us entry removal without the corresponding addition.
Gracefully ignore it instead of crashing.

Closes-Bug: #1357198
Change-Id: I5a0cc44ba62faf15d6fe3730a9532a3826647820
Delete DB records instead of tables to speedup UT

Now that the schema is fixed for all of the plugins,
there isn't a need to delete and recreate the entire
schema for every unit test.

This patch clears the tables at the end of each test
instead of deleting them. This eliminated overhead seems
to save 10%+ execution time of the entire set of unit
tests.

Example of performance gain from tox -epy27 tests.unit.ml2:
Before: Ran 2495 tests in 284.186s
After: Ran 2495 tests in 223.299s

Change-Id: Ic5bcbb0cf941e0745890abc776d719e58bb42e35
Fix to delete user and group association in Nuage Plugin

After a router delete operation, the attached zone to that
router is also deleted. Got rid of code that tried to do
a get operation on the nuage_zone after router delete
operation.
Closes-Bug: #1367864

Change-Id: I01753a472200a961cdcecee703616fd3239abd3c
Rework and enable VPNaaS UT for Cisco CSR REST

The Cisco CSR REST client library unit tests were developed in
Icehouse, using the httmock library. However, the community did
not want to add this library to global requirements, as there was
a similar httpretty library available (albeit with some short-
comings). As a result, the test module was renamed with a "no"
prefix, to prevent inclusion in automated tests.

Since then, a new library, requests-mock, has been added to global
requirements, to replace httpretty, and is being used on several
other projects.

This commit reworks the unit test to use requests-mock, instead of
httmock. The functionality is the same, but the mechanism (a
fixture with URI registration vs context manager) is different.

This commit provides coverage for the REST client code, by using a
mock for the Cisco CSR VM. The unit test module can be subclassed,
and used with a real CSR VM, for 3rd party CI testing, in the
future.

Change-Id: I55c8a253eb32985bc2016ae748b1ded58d021e1a
Closes-Bug: 1358470
Fix 500 error on retrieving metadata by invalid URI

An invalid URI should return a BadRequest error rather
than making the metadata proxy bomb out.

Closes-bug: #1371160

Change-Id: Ifb495f9e8929062a0c24d090c3e702109a38803a
DVR to delete router namespaces for service ports

Earlier merge that enabled LBaaS in DVR with review #114141
had not covered the removal of DVR router namespace on
VIP Port deletion in ml2 plugin.

Here we fix the ml2 plugin to attempt namespace removal for
all dvr serviced ports.

Change-Id: Ie7930ebedb12212886d45294132fefff7296e104
Closes-Bug: #1364839
Use dict_extend_functions to populate provider network attributes

Use dict_extend_functions mechanism to handle populating additional
provider network attributes into Network model in Nuage plugin.

Change-Id: I72e5afe3d03ae223fcd8e75f1f4f07624c3a7daf
Closes-Bug: #1362308
ofagent: Drop log level of tenant-triggerable events

To prevent evil tenants from flooding logs.

Closes-Bug: #1372196
Change-Id: I617e9fedf8a8c5e95c6067b716c83778d4d8cc7e
Imported Translations from Transifex

Change-Id: If3c928da9856fae84b139c78ee04573daf562a95
Add logging for enforced policy rules

There are a lot of policy rules which should not necessarily
be explicitly specified in policy.json to be checked while enforcement.
There should be a way for an operator to know which policy rules are
actually being enforced for each action.

Added a unit test.

Change-Id: I261d3e230eced9ea514b35cc3f5f8be04f84c751
Closes-Bug: #1356679