Browse Source

adapt to neutron_lib

Change-Id: I19f214d3955b78eabea6b89563e81bd46d8c76a0
Itsuro Oda 1 year ago
parent
commit
b61d857d8f

+ 2
- 2
networking_lagopus/ml2/agent/lagopus_agent.py View File

@@ -14,6 +14,7 @@ import eventlet
14 14
 import os
15 15
 import sys
16 16
 
17
+from neutron_lib import constants
17 18
 from neutron_lib import context
18 19
 from neutron_lib.utils import helpers
19 20
 from oslo_config import cfg
@@ -29,7 +30,6 @@ from neutron.api.rpc.callbacks import resources
29 30
 from neutron.common import config as common_config
30 31
 from neutron.common import rpc as n_rpc
31 32
 from neutron.common import topics
32
-from neutron.plugins.common import constants as p_constants
33 33
 from neutron.plugins.ml2.drivers.agent import config as agent_config  # noqa
34 34
 
35 35
 from networking_lagopus.agent import lagopus_lib
@@ -311,7 +311,7 @@ class LagopusManager(object):
311 311
 
312 312
     def get_bridge(self, segment):
313 313
         vlan_id = (segment['segmentation_id']
314
-                   if segment['network_type'] == p_constants.TYPE_VLAN
314
+                   if segment['network_type'] == constants.TYPE_VLAN
315 315
                    else 0)
316 316
         phys_net = segment['physical_network']
317 317
         if phys_net not in self.phys_to_dpid:

+ 2
- 3
networking_lagopus/ml2/mech_driver/mech_lagopus.py View File

@@ -13,11 +13,10 @@
13 13
 from neutron_lib.api.definitions import portbindings
14 14
 from neutron_lib import constants
15 15
 from neutron_lib import context as n_context
16
+from neutron_lib.plugins.ml2 import api
16 17
 from oslo_log import helpers as log_helpers
17 18
 from oslo_log import log as logging
18 19
 
19
-from neutron.plugins.common import constants as p_constants
20
-from neutron.plugins.ml2 import driver_api as api
21 20
 from neutron.plugins.ml2.drivers import mech_agent
22 21
 
23 22
 from networking_lagopus.agent import rpc
@@ -38,7 +37,7 @@ class LagopusMechanismDriver(mech_agent.SimpleAgentMechanismDriverBase):
38 37
         self.lagopus_api = rpc.LagopusAgentApi()
39 38
 
40 39
     def get_allowed_network_types(self, agent=None):
41
-        return [p_constants.TYPE_FLAT, p_constants.TYPE_VLAN]
40
+        return [constants.TYPE_FLAT, constants.TYPE_VLAN]
42 41
 
43 42
     def get_mappings(self, agent):
44 43
         return agent['configurations'].get('bridge_mappings', {})

Loading…
Cancel
Save