From fbe4a1d14114ce6a2fb480ce69120795192ccf6d Mon Sep 17 00:00:00 2001 From: Qin Zhao Date: Wed, 31 Oct 2018 16:30:45 +0800 Subject: [PATCH] Support CMCC Kilo --- f5lbaasdriver/v2/bigip/disconnected_service.py | 3 +-- f5lbaasdriver/v2/bigip/driver_v2.py | 2 +- f5lbaasdriver/v2/bigip/exceptions.py | 2 +- f5lbaasdriver/v2/bigip/neutron_client.py | 5 +++-- f5lbaasdriver/v2/bigip/plugin_rpc.py | 9 +++++---- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/f5lbaasdriver/v2/bigip/disconnected_service.py b/f5lbaasdriver/v2/bigip/disconnected_service.py index c34a96906..b96f23455 100644 --- a/f5lbaasdriver/v2/bigip/disconnected_service.py +++ b/f5lbaasdriver/v2/bigip/disconnected_service.py @@ -13,7 +13,6 @@ # limitations under the License. # -from neutron.db import segments_db from neutron.plugins.ml2 import db from neutron.plugins.ml2 import models @@ -52,7 +51,7 @@ def get_network_segment(self, context, agent_configuration, network): agent_configuration.get('tunnel_types', []) ] # look up segment details in the ml2_network_segments table - segments = segments_db.get_network_segments(context, network['id'], + segments = db.get_network_segments(context, network['id'], filter_dynamic=None) for segment in segments: diff --git a/f5lbaasdriver/v2/bigip/driver_v2.py b/f5lbaasdriver/v2/bigip/driver_v2.py index be817135d..53fa6c724 100644 --- a/f5lbaasdriver/v2/bigip/driver_v2.py +++ b/f5lbaasdriver/v2/bigip/driver_v2.py @@ -27,7 +27,7 @@ from neutron.callbacks import resources from neutron.extensions import portbindings from neutron.plugins.common import constants as plugin_constants -from neutron_lib import constants as q_const +from neutron.common import constants as q_const from neutron_lbaas.db.loadbalancer import models from neutron_lbaas.extensions import lbaas_agentschedulerv2 diff --git a/f5lbaasdriver/v2/bigip/exceptions.py b/f5lbaasdriver/v2/bigip/exceptions.py index ad574f25e..9e9c67a90 100644 --- a/f5lbaasdriver/v2/bigip/exceptions.py +++ b/f5lbaasdriver/v2/bigip/exceptions.py @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from neutron_lib import exceptions as q_exc +from neutron.common import exceptions as q_exc class F5LBaaSv2DriverException(q_exc.NeutronException): diff --git a/f5lbaasdriver/v2/bigip/neutron_client.py b/f5lbaasdriver/v2/bigip/neutron_client.py index 995d37469..26542ea6f 100644 --- a/f5lbaasdriver/v2/bigip/neutron_client.py +++ b/f5lbaasdriver/v2/bigip/neutron_client.py @@ -17,7 +17,8 @@ from neutron.extensions import portbindings -from neutron_lib import constants as neutron_const +from neutron.common import constants as neutron_const +from neutron.api.v2 import attributes as attrs from oslo_log import helpers as log_helpers from oslo_log import log as logging @@ -38,7 +39,7 @@ def create_port_on_subnet(self, context, subnet_id=None, port = None if not mac_address: - mac_address = neutron_const.ATTR_NOT_SPECIFIED + mac_address = attrs.ATTR_NOT_SPECIFIED if subnet_id: try: diff --git a/f5lbaasdriver/v2/bigip/plugin_rpc.py b/f5lbaasdriver/v2/bigip/plugin_rpc.py index 3d07a55d7..f0ebe8711 100644 --- a/f5lbaasdriver/v2/bigip/plugin_rpc.py +++ b/f5lbaasdriver/v2/bigip/plugin_rpc.py @@ -25,7 +25,8 @@ from neutron_lbaas.db.loadbalancer import models from neutron_lbaas.services.loadbalancer import constants as nlb_constant -from neutron_lib import constants as neutron_const +from neutron.common import constants as neutron_const +from neutron.api.v2 import attributes as attrs from oslo_log import helpers as log_helpers from oslo_log import log as logging @@ -512,7 +513,7 @@ def create_port_on_subnet(self, context, subnet_id=None, subnet_id ) if not mac_address: - mac_address = neutron_const.ATTR_NOT_SPECIFIED + mac_address = attrs.ATTR_NOT_SPECIFIED fixed_ip = {'subnet_id': subnet['id']} if fixed_address_count > 1: fixed_ips = [] @@ -680,7 +681,7 @@ def create_port_on_network(self, context, network_id=None, ) if not mac_address: - mac_address = neutron_const.ATTR_NOT_SPECIFIED + mac_address = attrs.ATTR_NOT_SPECIFIED if not host: host = '' if not name: @@ -694,7 +695,7 @@ def create_port_on_network(self, context, network_id=None, 'admin_state_up': True, 'device_owner': 'network:f5lbaasv2', 'status': neutron_const.PORT_STATUS_ACTIVE, - 'fixed_ips': neutron_const.ATTR_NOT_SPECIFIED + 'fixed_ips': attrs.ATTR_NOT_SPECIFIED } if device_id: port_data['device_id'] = device_id