From 2958996cfa1d8ca275e31492a2c48a8368ab5528 Mon Sep 17 00:00:00 2001 From: Shashank Hegde Date: Fri, 13 Mar 2015 11:16:55 -0700 Subject: [PATCH] Migrate to oslo.log Neutron has moved to oslo.log for all logging and the log module in neutron has been removed. networking-arista was using the log module which caused the driver to fail loading. Change-Id: I433a15d66a6bb7d8e3f4992d31fceedd97169616 --- networking_arista/common/db_lib.py | 8 ++++++++ networking_arista/ml2/arista_ml2.py | 2 +- .../tests/unit/ml2/test_arista_mechanism_driver.py | 2 +- requirements.txt | 3 ++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/networking_arista/common/db_lib.py b/networking_arista/common/db_lib.py index 9c4491f2..a4d19efb 100644 --- a/networking_arista/common/db_lib.py +++ b/networking_arista/common/db_lib.py @@ -331,6 +331,14 @@ class NeutronNets(db_base_plugin_v2.NeutronDbPluginV2): return super(NeutronNets, self).get_ports(self.admin_ctx, filters=filters) or [] + def get_shared_network_owner_id(self, network_id): + filters = {'id': [network_id]} + nets = self.get_networks(self.admin_ctx, filters=filters) or [] + if not nets: + return + if nets[0]['shared']: + return nets[0]['tenant_id'] + def _get_network(self, tenant_id, network_id): filters = {'tenant_id': [tenant_id], 'id': [network_id]} diff --git a/networking_arista/ml2/arista_ml2.py b/networking_arista/ml2/arista_ml2.py index c35932fd..37e10779 100644 --- a/networking_arista/ml2/arista_ml2.py +++ b/networking_arista/ml2/arista_ml2.py @@ -17,11 +17,11 @@ import itertools import jsonrpclib from oslo.config import cfg +from oslo_log import log as logging from neutron.common import constants as n_const from neutron.i18n import _LI from neutron.i18n import _LW -from neutron.openstack.common import log as logging from neutron.plugins.ml2.drivers.arista import exceptions as arista_exc from networking_arista.common import db_lib diff --git a/networking_arista/tests/unit/ml2/test_arista_mechanism_driver.py b/networking_arista/tests/unit/ml2/test_arista_mechanism_driver.py index 38d6d2af..efd80a96 100644 --- a/networking_arista/tests/unit/ml2/test_arista_mechanism_driver.py +++ b/networking_arista/tests/unit/ml2/test_arista_mechanism_driver.py @@ -765,7 +765,7 @@ class FakePortContext(object): return self._original_port.get(portbindings.HOST_ID) -class SyncServiceTest(base.BaseTestCase): +class SyncServiceTest(testlib_api.SqlTestCase): """Test cases for the sync service.""" def setUp(self): diff --git a/requirements.txt b/requirements.txt index 6ead9fea..477de0cb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,6 +2,7 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -pbr>=0.6,!=0.7,<1.0 Babel>=1.3 +oslo.log>=0.4.0 # Apache-2.0 +pbr>=0.6,!=0.7,<1.0 -e git://git.openstack.org/openstack/neutron.git#egg=neutron