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
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
ML2 BigSwitch: Don't modify parent context

Makes a copy of the port context before changing
it in preparation for the backend controller so
other drivers are not affected. Also removes a
UT that was exercising direct modification of VIF
details in the port context, which is not allowed
by the ML2 plugin.

Closes-Bug: #1294308
Change-Id: I47281dcd23c022813b8b6eda0a3d39c4482277b9
Allow CIDRs with non-zero masked portions

Allow users to specify CIDRs with bits other
than zeros in the masked portion of the subnet.
e.g. 192.168.1.5/24 is accepted and converted
to 192.168.1.0/24.

Closes-Bug: #1204173
Change-Id: I7ddff41e6988feb6e2a87e40a4d99db7174415b1
NEC plugin: Honor Retry-After response from OFC

A backend OpenFlow controller nec plugin talks to can return
503 response with retry-after header when it is busy.
It is better to honor retry-after header to avoid unnecessary
user-visible errors due to temporary busy condition.

Change-Id: I2ff1c3ac8402a2207bd955e9a9bb61e147950c5c
Closes-Bug: #1294527
Add a semaphore to some ML2 operations

This patch adds a semaphore for serializing the delete port API
calls and update_port_status calls to avoid simultaneous
attempts to acquire SQL update locks on the port table from
the same thread pool.

This semaphore has been introduced to avoid undesired eventlet
yields which trigger 'lock wait timeout' errors in the DB backend;
it should have a negligible impact on the overall performance.

Change-Id: I0ec947086e533945942ae93402943dec69b218ef
Partial-Bug: 1283522
Merge "Add a semaphore to some ML2 operations"
Merge "NEC plugin: Honor Retry-After response from OFC"
Merge "BigSwitch: Widen range of HTTPExceptions caught"
Merge "ML2 BigSwitch: Don't modify parent context"
Merge "Allow CIDRs with non-zero masked portions"
Merge "Process ICMP type for iptables firewall"
Merge "BigSwitch: Use eventlet.sleep in watchdog"