Remove unnecessary call to get_dhcp_port from DeviceManager

Change-Id: I35459c352e712ea009589f3050205a4c307b909a
Closes-Bug: #1263217
Validate multicast ip range in Cisco N1kv Plugin

Do the validation of multicast ip range in Cisco N1kv Plugin and send
appropriate parameters to VSM.

Change-Id: Iaa1288d8a6deb2a2f32b263d4556dde8938d75f5
Closes-Bug: #1282754
Delete duplicate internal devices in router namespace

When neutron router-interface-delete <router> <subnet> is ran
during L3-agent restart, the agent may fail to delete the old
internal device. After the restart, when the command "neutron
router-interface-add <router> <subnet>" is ran again, the
router ends up having two internal devices configured with the
same IP address.

Closes-Bug: #1244853
Change-Id: I0d7e2db6aa7dae26d0fc3fe1b1527762cb1e3b23
ML2 Cisco Nexus MD: VM migration support

Add VM (live) migration support to the ML2 cisco nexus mechanism driver.

Change-Id: I8be2fc1f020ef1fc6c19daba0a9e278629046016
Closes-Bug: #1247976
Add missing ondelete option to Cisco N1kv tables

Update the DB migration script, which creates the Cisco N1kv tables,
to include the ondelete='CASCADE' option in network and port
binding tables. This allows proper clean up of network and port
binding entries on respective delete operations, when the tables
are populated via DB migration script.

Closes-Bug: #1294434

Change-Id: I5dad7bd718b75cfd8825b08336e834d64bddd196
NSX: Make replication mode configurable

The replication mode on switches and routers should have been configurable
to use source replication if one did not want to deploy service node(s).
This patch fixes that by making this option configurable.

Change-Id: Id9e8043c602b5e9349c10247eab993e59db5a52c
Closes-bug: #1285383
NSX: Sync do not pass around model object

The NSX sync backend previously passed around a sqlalchemy model object
around which was nice because we did not need to query the database an
additional time to update the status of an object.

Unfortunately, this was add done within a db transaction which included a
call to NSX which could cause deadlock this needed to be removed. Now a
dict is passed around instead and proper transaction handling
is used when updating objects.

Change-Id: Id50abd8f2143b127d1ca81c360c1c6d400e1d74f
Closes-bug: #1281772
Fix bug:range() is not same in py3.x and py2.x

in python3.x, there is no method named xrange(),
it has replaced by range(),which is equal to xrange() in python2.x.
so we must fix this issue.we use six module to fix this issue.

Change-Id: I9cee3f0df2d8abbf6f66d7c5a3a0fed98df622e8
Closes-Bug: #1268439
BigSwitch: Widen range of HTTPExceptions caught

In order to trigger a reconnect, the Big Switch
plugin was only checking for httplib.ImproperConnectionState
which doesn't include relevant exceptions that
indicate a reconnect is necessary. This patch
adjusts it to reconnect on any HTTPException.

Closes-Bug: #1289236
Change-Id: I4b389172dc4a53b0381e40005d8421f71b7d8522
BigSwitch: Use eventlet.sleep in watchdog

Changes the consistency watchdog that runs
in the background to use eventlet.sleep instead
of time.sleep to avoid blocking other members of
the same pool.

Closes-Bug: #1291695
Change-Id: I5ec842cca1063cef761c2cd09d63617baf27d191
API layer documentation

* Discuss the WSGI layer of Neutron
* Describe the startup code that creates the WSGI application
* Briefly discuss the URL routing and resource creation

Change-Id: Id82a2a5679d7e29c0a19d1a20942a9249946b011
Kill 'Skipping unknown group key: firewall_driver' log trace

This is done by trying to import the option first. If this
does not work, emit a warning instead as in most cases this is
harmless for a number of reasons: a) the service might not
even need the opt; b) if things do break down the line, we'll
see bigger traces; c) it's not gonna be long for this legacy
quantum/neutron stuff to be removed altogether.

Closes-bug: 1210121

Change-Id: I34917da9cb6117ee1d42140621c742f503279b6b
NSX: lower the severity of messages about VIF's on external networks

Set the message to INFO as there is no error to recover from or
something bad about to happen. The only place where this occurs
is during the setup of probe interfaces in DevStack.

Change-Id: I2310af00676e508646783ce769a8830ab0b9308f
Bugfix and refactoring for ovs_lib flow methods

Remove hardcoded flow parameters from
'_build_flow_expr_str' method, so we can
define any flows we want and can rely on 'ovs-ofctl'
command to verify flow arguments correctness.
When building flow string inside _build_flow_expr_str
use the following approach:
1. Build prefix and remove prefix params from flow_dict.
2. Build postfix (actions) and remove 'actions' from
flow dict.
3. Inside the loop build flow array from everything
what's left in flow_dict.
4. Append postfix (actions) to the flow array.
5. 'Join' flow array into flow string.

Change _build_flow_expr_str() to be a function
instead of an object method because 'self'
parameter  wasn't used.

Remove 'add_or_mod_flow_str' method because
we have to use separate logic when bulding flow
strings for 'add_flow' and 'mod_flow' methods.

Add more unit tests for OVSBridge class.

Closes-Bug: #1255058
Closes-Bug: #1240572

Change-Id: Ic89221d006a626aa2fc40314a9acffc0ea6fd61c
cisco: Do not change supported_extension_aliases directly

cisco network plugin extends supported_extension_aliases in __init__
but supported_exntension_aliases is a class attribute and it is not
reset to the original even after each unit test finished.
To avoid this this patch copies supported_extension_aliases to
an instance attribute and extends it to ensure the class variable
is not changed. This reduces unnecessary logs in unit tests.

Change-Id: I3a7313f5ca2d10b1ae6ea961d9d05611aee055c0
Closes-Bug: #1292742
Added missing l3_update call in update_network

Change-Id: Id907ae692140fd52762ef6ac4fc1613897eb5065
Closes-Bug: #1259125
Process ICMP type for iptables firewall

In current security group code, source_port_range_min
and source_port_range_max are used to specify icmp type
and code when security group rule protocol is icmp.
However, the code _port_arg in iptables_firewall called
by _convert_sgr_to_iptables_rules skips protocol icmp
when processing the arg. This happens to both ipv4 and
ipv6 icmp firewall rules.

This fix adds --icmp-type to iptables firewall rule when
icmp type is specified.

Closes-Bug: 1289088

Change-Id: Iebf109f246d47cffc26ab3c2cf113234a4b2cffe
NSX: Ensure gateway devices are usable after upgrade

The gateway device database migration upon an upgrade creates
gateway devices objects from references in network gateway
objects.
While these gateway devices are perfectly usable
in network gateways, they are not directly visible to tenants
and also cannot be updated to change details such as name,
connector type or ip as well as the client certificate.

This patch fixes the DB migration in order to ensure tenant
have access to gateway devices created after an upgrade.
This patch also modifies the l2 gateway nsxlib module to
ensure request bodies are correctly created even when not all
the attributes of a gateway device are specified.

Change-Id: I7077e9884adc739fb75e64a6e9a17a124d79fb6b
Closes-Bug: 1293617
BigSwitch: Sync workaround for port del deadlock

Adds a synchronization barrier to the methods
that lock the port table to avoid the mysql
update-lock/eventlet-yield deadlock that occurs
with simultaneous port deletions.

Closes-Bug: #1292232
Change-Id: I8975a14a937a5843a0395ad7b599ebdc827565ed
Remove individual cfg.CONF.resets from tests

oslo.config.CONF.reset is added to cleanup in BaseTestCase, so it does
not need to be done by individual test cases.

Change-Id: I5fced5c2d480e78e5bb7cc150f0b653313884456
Closes-Bug: #1291144