Big Switch: Don't use MagicMocks unnecessarily

Replace the mocks purely being used to block external
calls with functions that just return and don't record
calls.

Closes-Bug: #1315574
Change-Id: I79533135b5cb456d941ddffa62f5365970146a7e
Use list copy for events in nova notifier

There is no need to call range() and len() and .pop() for such a
simple task as list copy.

Change-Id: I4d25e0887ba0a7a5c7f49d195e90a7d2818caac2
Removes unnecessary Embrane module-level mocks

The embrane unit tests install a magicmock into
the system modules at the module level which
persists across all unit tests and isn't required.
This patch removes the unnecessary and limits the
life of the module mocks where they are necessary.

Partial-Bug: #1316401
Change-Id: Iaa38ee0c6821d46a6d78eefef39006df2c1c47e5
Cisco APIC Layer 3 Service plugin

This plugin provides Layer 3 features for the Cisco APIC.
The service plugin is currently limited to internal gateways
due to limitations in the Hardware.

Change-Id: I81cde4d721f9d72ec67baaf64ab91148b3799d78
Implements: blueprint cisco-apic-l3
Sync service module from oslo-incubator

This is needed for the stop method now implemented in service.py used here:
https://review.openstack.org/#/c/72564

Current oslo-incubator commit on HEAD
ad3c887fbfc81ac3502a3e49c1ed6c2824029c25

Change-Id: I66901c0c42472be1aadab803958932bcb9be8ee1
Return no active network if the agent has not been learnt yet

Sometimes the agent message to get the active networks is
processed before the agent is learnt by Neutron. Neutron throws an
error, but it should simply return no network

Change-Id: I6da0ca578cfe1fe0885138a5e2da76278f791491
Closes-bug: #1302838
Added note to neutron.conf

Added note to neutron.conf which clarifies where database
connection attribute should be set.

Change-Id: Ic0631cff789046528cae8622d935b65ae9b012cb
Closes-Bug: #1261298
OVS Agent: limit veth names to 15 chars

The maximum length of a veth interface name is 15 characters.
This patch limits the length of the veth names created for
integration bridges by switching to a fixed-length hashing
mechanism if the normal name would exceed the allowed length.

Closes-Bug: #1328288
Change-Id: I432cee62a6dc91f268becbc91f8024c23dd0bfac
Big Switch: Call correct method in watchdog

Updates the consistency watchdog fuction to call
the correct rest method.

Closes-Bug: #1328321
Change-Id: I86ce0af36f6764a3f1e789602cef52758caedc8b
Replace XML with JSON for N1kv REST calls

Currently the cisco n1kv plugin handles XML responses from VSM.
This change will replace the httplib2 with requests library and handle
JSON responses from the VSM.

Implements: blueprint cisco-n1kv-json-support

Change-Id: Icd32a6a2ab815ccd24ad86371e927c132e204413
Big Switch: Add missing data to topology sync

Adds data to the topology sync function that was
missing in the case where it is called from the
ML2 driver.

Closes-Bug: #1328222
Change-Id: I1cc3b0430f63f62c881f28139d1e5ebf22766357
Increase default metadata_workers, backlog to 4096

While deployment tools might want to change the number of workers
to match the number of cores (Or some fraction of it), any default
other than 1 should be outright better.

Inspired from 19:34:
https://www.youtube.com/watch?v=AF9r_VQrcJ0

DocImpact
Closes-Bug: #1323005
Change-Id: Ie90000183ae67ff391a23ca3213fd23aef5f4dc5
Check NVP router's status before deploying a service

With NVP advanced service plugin, router creation is asynchronous while
all service call is synchronous, so it is possible that advanced service
request is called before edge deployment completed.
The solution is to check the router status before deploying an advanced service.
If the router is not in ACTIVE status, the service deployment request would return
"Router not in 'ACTIVE' status" error.

Change-Id: Idde71c37f5d5c113ac04376ed607e0c156b07477
Closes-Bug: #1298865
Fix NVP FWaaS occurs error when deleting a shared rule

It is due to the lack of edge_id query index  when deleting the
vcns_edge_firewallrule_binding entry, which leads to deleting
rule binding entrys on both edges.
Closes-Bug: #1322105

Change-Id: I1d15a06bd2a6c42f29c8258d4b9344c8e9338638
Use import from six.moves to import the queue module

The name of the synchronized queue class is queue instead of
Queue in Python3.

Change-Id: I5c5aba89b30b311bbfba2b64c61ea566d339b7c9
Closes-Bug: #1327975
Big Switch: Catch exceptions in watchdog thread

Catch and log exceptions in the watchdog greenthread to prevent
them from stopping the periodic consistency checks.

Closes-Bug: #1330135
Change-Id: I6834c0fee0429bb72b8c61307be7bdca77f6de9b
ofagent: Fix VLAN usage for TYPE_FLAT and TYPE_VLAN

while ofagent uses OF1.3, the current coding incorrectly uses
OF1.0 terms in some places.  namely, _local_vlan_for_flat uses
0xffff to mean "no VLAN".  it should use OFPVID_NONE and
pop_vlan/push_vlan appropriately.  the same problem exists for
reclaim_local_vlan.

Closes-Bug: 1301144
Change-Id: I3df821fd72471f8bd84366e3b5a1cc7e3489156c
Support Subnets that are configured by external RAs

The IPv6 attributes for subnets provides support for IPv6 subnets that
are managed by non-OpenStack gateway devices, by creating a subnet that
has the ipv6_ra_mode attribute not set, and the ipv6_address_mode
attribute set to IPV6_SLAAC.

In order to support stateless IPv6, Neutron should calculate an IPv6
address based on the IPv6 prefix and MAC address via EUI-64 specification,
and assign this address to the port.

Implements blueprint ipv6-provider-nets-slaac

DocImpact

Change-Id: Ia76d76a67e0dc9f996a72e38d987a05aecc1b55f
Co-Authored-By: Xu Han Peng <xuhanp@cn.ibm.com>
Co-Authored-By: Dazhao Yu <dzyu@cn.ibm.com>
Control update, delete for cisco-network-profile

Add new behavior to control update and delete operations for the
cisco-network-profile resource extension.
The new behavior is to allow update and delete operations only if
there are no neutron networks associated with a particular
cisco-network-profile instance

Change-Id: I000a03c1ffd5c02e7b827ec757287633e5a5dd64
Closes-Bug: #1323867
extensions: remove 'check_env' method

The method is not documented or used.
It was introduced for quota but unused since commit 603e3b78.

Closes-Bug: #1328362
Change-Id: Id0a4d8606f34e54468ed0de26adbf25ff273079e