ofagent: Ignore unknown l2pop entry removals

l2pop can send us entry removal without the corresponding addition.
Gracefully ignore it instead of crashing.

Closes-Bug: #1357198
Change-Id: I5a0cc44ba62faf15d6fe3730a9532a3826647820
ofagent: Drop log level of tenant-triggerable events

To prevent evil tenants from flooding logs.

Closes-Bug: #1372196
Change-Id: I617e9fedf8a8c5e95c6067b716c83778d4d8cc7e
Drop sslutils and versionutils modules

The modules are not used since when we've switched to oslo.messaging.

Change-Id: Ife4298e0bb29ec15404fafe4b48545bd65e038e3
Reduce security group db calls to neutron server

Within ovs agent daemon loop, prepare_devices_filter will impose heavy workloads
to neutron server in order to retrieve the security groups message to apply
firewall rules. If agent is configured to use Noopfirewall driver or security
groups are disabled, there is no need for loading the rules from server and
refreshing the firewalls. This will reduce the number of db calls and improve
performance for neutron server in this case.

Change-Id: Id244aab3cac37fc6ed3dc05cbee91cdf9e34d9cc
Closes-Bug: #1365806
Compare subnet length as well when deleting DHCP entry

When searching for the DHCP subnet entry to delete, the existing code
compares only the subnet prefix and ignores subnet length.  This could
delete the wrong entry/entries if nested subnets are present.

Change-Id: Icf079c42adeca14ef84ec57dc45a5930fde8786d
Closes-Bug: #1362416
VPNaaS Cisco unit test clean-up

Removed unused args to mock side-effect function and duplicate
constant.

Change-Id: I5409ce86ccaab86213d65f757f19c1bdf9a66929
Closes-Bug: #1381221
Refactor _make_subnet_dict to avoid issuing unnecessary queries

Use joined loads for attributes dns_nameservers and host_routes.

As a result, particular scenarios like restarting DHCP agent
could benefit from improved server-side performance.

Change-Id: I6470356b601e2fcf74c7e0a6df438cef7099e9fe
Closes-Bug: #1374044
l3_agent: avoid name conflict with context

module name, context, conflicts with argument name in many place in
l3_agent. In order to avoid such conflict, import context as n_context
following Neutron practice.

Change-Id: Ic3754818f84064d2c8da04914826fc912437b2f0
Closes-Bug: #1381900
Only fetch port_id from SG binding table

Change a query to only retrieve the port_id instead of
every column from the row of security group binding info.

Partial-Bug: #1373851
Change-Id: I0fba9c9623898ee52590207ebbb728503bb59a5b
Updated fileutils and its dependencies

This is to avoid fileutils dependency on excutils that are now moved to
oslo.utils.

The following changes are included:

* neutron/openstack/common/__init__.py
  6b048e7 Let oslotest manage the six.move setting for mox

 * neutron/openstack/common/_i18n.py
  9ce1d96 Fix i18n import
  5d40e14 Remove code that moved to oslo.i18n

 * neutron/openstack/common/fileutils.py
  6ff6b4b Switch oslo-incubator to use oslo.utils and remove old modules
  2b966f9 Fix deletion of cached file for policy enforcer
  9c88dc3 file_open: fixed docstring to refer to open() instead of file()
  6c7407b fileutils: port to Python 3
  fcf517d Update oslo log messages with translation domains

 * neutron/openstack/common/log.py
  6c706c5 Delete graduated serialization files
  5d40e14 Remove code that moved to oslo.i18n
  6ff6b4b Switch oslo-incubator to use oslo.utils and remove old modules
  aa74411 log: add missing space in error message
  037dee0 Set stevedore log level to WARN by default
  37c0091 Add unicode coercion of logged messages to ContextFormatter
  6614413 Correct coercion of logged message to unicode
  1188d88 Except socket.error if syslog isn't running
  ac995be Fix E126 pep8 errors
  631f880 Set keystonemiddleware and routes.middleware to log on WARN level
  726d00a Adjust oslo logging to provide adapter is enabled for
  433fa0b Make logging_context_format_string optional in log.set_defaults
  ac92c06 Add default log level for websocket
  5fd77eb Ability to customize default_log_levels for each project
  4d9328c Python 3: enable tests/unit/test_log.py
  cb5a804 Move `mask_password` to strutils

Note: cb5a804 is partially included; that's ok because we don't use the
moved function in Neutron.

Change-Id: I3bfcaff2620b368d807e9468bb7abc01d6471661
Optimize query in _select_dhcp_ips_for_network_ids

Only query the DB for relevant columns instead of
all of the port columns.

Partial-Bug: #1373851
Change-Id: I32cd4a0bc6799ce77cea13188676308e3e641d19
Schema enhancement to support MultiSegment Network

Description:
Currently, there is nothing in the schema that ensures segments
for a network are returned in the same order they were specified
when the network was created, or even in a deterministic order.

Solution:
We need to add another field named 'segment_index' in
'ml2_network_segment' table containing a numeric position index.
With segment_index field we can retrieve the segments in the
order in which user created.

This patch set also fixes ML2 invalid unit test case in
test_create_network_multiprovider().

Closes-Bug: #1224978
Closes-Bug: #1377346

Change-Id: I560c34c6fe1c5425469ccdf9b8b4905c123d496d
Merge "Only fetch port_id from SG binding table"
Merge "Optimize query in _select_dhcp_ips_for_network_ids"
Merge "Refactor _make_subnet_dict to avoid issuing unnecessary queries"
Merge "Schema enhancement to support MultiSegment Network"
Merge "l3_agent: avoid name conflict with context"
Merge "VPNaaS Cisco unit test clean-up"
Merge "Reduce security group db calls to neutron server"
Merge "Updated fileutils and its dependencies"