Big Switch: Check for 'id' in port before lookup

Check for the presence of the 'id' key before trying
to do a lookup based on the value. This is necessary
because a 'fields' param to get_port(s) may exclude
the 'id' field before the host_id lookup.

Closes-Bug: #1358668
Change-Id: If30567d5deaeabd2de6c6287fac7a81695a41cc5
shared policy shouldn't have unshared rules

A shared firewall policy should always have shared rules. So the following
cases should not be allowed:
1.Create shared policy with unshared rules
2.Update policy shared=True when it has unshared rules
3.Update policy with shared=True and unshared rules
4.Update shared policy with unshared rules

Change-Id: I3d71899c328d3fefa96c1f99d6ba706160e445cc
Closes-bug: 1334981
Add requests_mock to test-requirements.txt

Already in global-requirements. Will use for VPN unit tests
(bug 116018).

Change-Id: I140caebd3bc4f4cbf9563698bf0143f68456c762
Closes-Bug: 1358472
Add unit-test assert to check dict is superset of dict

Several VPN unit tests need the ability to check that an expected
dict is found in the actual dict output (and that other elements are
ignored - like auth tokens).

Since this will be of use to other components, adding this to the
base test case.

Note: There is a similar assertDictContainsSubset(), however, it is
not supported in 2.6 and has been deprecated in 3.2. A different, and
hopefully clearer, name is used for this method.

Change-Id: I8becf9cfad966874f8463a9c835331f2f17d2ead
Closes-Bug: 1366797
Fix for floating ip association and deletion

Added code to associate fip to a vm in VSD, if
the fip was already associated with the vm port
in Neutron. Also added code in fip deletion,
to get the correct router id based on the check
if the fip is associated to a Neutron port or
not.
Closes-Bug: #1350469
Change-Id: I1aa24f420f656043086a4f501b15722216b843e9
Remove faulty .assert_has_calls([])

Some UT use <mock>.assert_has_calls([]) as a way to check if mock
wasn't called - this doesn't work because assert_has_calls only checks
if passed calls are present in mock_calls and hence it is always true
regardless of whether mock was called or not. This can lead to falsely
passed tests.

Change-Id: I1be5327854cc3dc2f5b3733f2bad78200cfbbfd2
Closes-Bug: #1368234
use TRUE in SQL for boolean var

The "allocated" variable was defined to be a boolean type
and in postgresql this type is enforced,
while in mysql this just maps to tinyint and accepts both numbers and bools

Closes-Bug: #1368251
Change-Id: If324c8b83e490e150085d044ac61360b647522ac
Cleanup floatingips also on router delete

In router remove path process_router(), processing of floating ips
is getting skipped. This change adds processing of floating ips
if the external gateway for the router was previously set. Since
DVR uses FIP namespaces and agent gateway ports, this change ensures
such ports and namespaces are removed.

Change-Id: Ib1d8fb54adcd8aab411dced695d171376687c980
Partial-bug: #1367588
Remove logic for conditional migrations

This patch removes the logic for handling conditional migrations
and adjusts all the patches where it was used accordingly.

The alembic environment has been update to not send anymore
the active plugins list to migrations.

This patch also removes the vestigial 'options' parameter which
was sent to every migration but always set to None and never
used by any migration.

Implements blueprint bp/reorganize-migrations

Change-Id: I7285e0276b262a9ea5d22c456a5a8cf34c461a0c
Stop using intersphinx

Remove intersphinx from the docs build as it triggers network calls that
occasionally fail, and we don't really use intersphinx (links other
sphinx documents out on the internet)

This also removes the requirement for internet access during docs build.

This can cause docs jobs to fail if the project errors out on
warnings.

Change-Id: I71e941e2a639641a662a163c682eb86d51de42fb
Related-Bug: #1368910
Imported Translations from Transifex

Change-Id: I6aacdfe6ced9645aaec56b5a2a0516c167a7b5fd
Merge "Cleanup floatingips also on router delete"
Don't create unused ipset chain

when a security group don't have members, it should not create corresponding
ipset chain.

Change-Id: Ia04ffb3ac539c9a89a882e6dd91f373cb67c6f8b
Closes-bug: #1369431
Merge "Add requests_mock to test-requirements.txt"
Merge "Big Switch: Check for 'id' in port before lookup"
Merge "Fix for floating ip association and deletion"
BSN: Add context to backend request for debugging

Include the request context with calls to the backend
Big Switch controllers to assist with event correlation
and debugging object provenance. The auth token is
stripped since this information is sensitive and
these requests will appear in debug logs.

This also removes mutable objects from default arguments
in some of the server manager function definitions that
were interferring with the new use of the headers dict.

Closes-Bug: #1364696
Change-Id: I5b80b1596cc145742457b3603cbcd67f6e0d9f36
Merge "Stop using intersphinx"
Merge "Remove logic for conditional migrations"
Merge "BSN: Add context to backend request for debugging"