Fix dhcp agent rpc exception handling

fixes bug 1046904

This patch adds exception handling to log rpc exceptions.  Previously,
the agent would terminate due to uncaught errors during initialization.

Change-Id: I4835c1616e2ccfc9c42c591e8c7446db50721d01
remove incorrect mock assert_called in unit tests

fixes bug 1047569

The unit tests were calling a nonexistent assert_called() on the
mocks.  This patch fixes the problem by using the correct assert for
checking that the mocked method was invoked.

Note: This patch does not fix the error in test_call_driver() because a
separate bug fix revises the test.

Change-Id: Ie62e2e64f314f9ba34761e63cd5d0d6e44c5d094
Fix data passed to policy engine on update

fix bug 1044218

The original resource status fetched to the db was not being
properly updated with the request body before feeding it to the
policy engine

Change-Id: I9f71e40edf44136a40fad1ef272696d6b3ea352d
add local network type and use by default for tenant networks

Fixes bug 1045142.

This patch adds 'local' as a new value for provider:network_type,
supported by the openvswitch and linuxbridge plugins. Networks of this
type provide connectivity through a bridge for VMs and agents local to
the host, but no external connectivity. They do not require
provider:physical_network or provider:segmentation_id values. These
local networks are intended mainly to support single-box
zero-configuration testing (including quantum gating), but may have
other uses as well.

For openvswitch, the new OVS.tenant_network_type configuration
variable selects what type of networks are allocated as tenant
(i.e. non-provider) networks. It defaults to 'local', but must be
changed to 'vlan' or 'gre' for openvswitch tenant networks to have
external connectivity. The default value is intended to support
single-box zero-configuration testing without any need to allocate
physical network resources or configure bridges, and without requiring
the operating system to support OVS GRE tunneling. It can also be set
to 'none' to completely disable creation of tenant networks.

For linuxbridge, the new VLANS.tenant_network_type configuration
variable works similarly, with a value of 'vlan' supporting tenant
networks with external connectivity.

With either plugin, administrators can create provider local networks
by specifying "--provider:network_type local". Additionally, with
openvswitch, provider GRE networks can now be created by specifying
"--provider:network_type gre --provider:segmentation_id <tunnel-id>".

A corresponding devstack patch is available at
https://review.openstack.org/#/c/12456/. With this patch, the
openvswitch and linuxbridge plugins are by default configured to
support only local networks. A set of shell variables, documented in
stack.sh, can be set in localrc to configure remote connectivity,
including bridges/interfaces available for provider networks.

Change-Id: I2812548326141d2212d04f34d5448fb974d298e0
check subnet overlapping when adding interface to router

Fixes bug 1046061

Add logic in _check_for_dup_router_subnet to check subnets are not overlapped.
Add testcase test_router_add_interface_overlapped_cidr.

Change-Id: I71b6cce07273686cc5e4636ce640b7201ce00b32
Merge "check subnet overlapping when adding interface to router"
Fix broken L3 support of Ryu plugin

Fixes bug 1047230

This patch adds support for the router:external attribute of a network
to Ryu plugin.

Change-Id: I135fe0a4e90fe049cabbaa1b87e9294ec0613530
Merge "Fix dhcp agent rpc exception handling"
Modified code Pyflakes warning.

File config.py:
W402 'os' imported but unused

Change-Id: Ie6e728183638312ccfa09e62626e05a49289009b
Modified code Pyflakes warning.

File iptables_manager.py:
W402 'ConfigParse' imported but unused
W402 'subprocess' imported but unused

Change-Id: Ib364835518c0517dbe9e95d1ac6445bfbd704860
Modified code Pyflakes warning.

File ovs_lib.py:
W402 'shlex' imported but unused
W402 'signal' imported but unused
W402 'subprocess' imported but unused

Change-Id: I10132c42390f1ea4b1a6171146d7bee0e1b0d8fa
Modified code Pyflakes warning.

File l3_agent.py:
W402 'linux_utils' imported but unused

Change-Id: I774cb00c2d55ffdd1184694810bb7a7f6e3de724
Modified code Pyflakes warning.

File netns_cleanup_util.py:
W402 'os' imported but unused
W402 'traceback' imported but unused

Change-Id: I439341d82198895412b1610cab607396c559ccb0
Modified code Pyflakes warning.

File api_common.py:
W402 'wsgi' imported but unused

Change-Id: If475bae879d2f0412d48fed5eb5c819c7d941f14
Modified code Pyflakes warning.

File utils.py:
W402 'datetime' imported but unused
W402 'inspect' imported but unused
W402 'exception' imported but unused

Change-Id: I07ad88653e1b0a98ea80a6206890428de3f24865
Modified code Pyflakes warning.

File api.py:
W402 'q_exc' imported but unused

Change-Id: Ibe8fa9c3b3607165bcd30867ef0df71aea04806b
Modified code Pyflakes warning.

File dhcp_rpc_base.py:
W402 'db' imported but unused

Change-Id: Ie376f3b9bf4745b33d57a47f520ea8a4cb58be10
Add IP commands to rootwrap fileter for OVS agent

Fixes bug 1045598

Change-Id: I97151030e5f3a71202b583dea6797ca16bd34f7c
Merge "Add IP commands to rootwrap fileter for OVS agent"
Merge "remove incorrect mock assert_called in unit tests"