Migrate Neutron constant and exception references to neutron-lib

Change-Id: I813caf0462aa869f72483d849d1a439926848c15
Partially-implements: bp neutron-lib
changes/13/396313/3
Mark McClain 6 years ago
parent aab114938a
commit e953b29522

@ -16,7 +16,7 @@
"""Exceptions used by Arista ML2 Mechanism Driver."""
from neutron.common import exceptions
from neutron_lib import exceptions
class AristaRpcError(exceptions.NeutronException):

@ -19,6 +19,7 @@ import json
import os
import socket
from neutron_lib import constants as n_const
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import excutils
@ -28,7 +29,6 @@ from six import add_metaclass
from neutron._i18n import _LE
from neutron._i18n import _LI
from neutron._i18n import _LW
from neutron.common import constants as n_const
from neutron.extensions import portbindings
from networking_arista.common import db_lib

@ -15,13 +15,12 @@
import threading
from neutron_lib import constants as const
from neutron_lib import constants as n_const
from oslo_config import cfg
from oslo_log import log as logging
from neutron._i18n import _LE
from neutron._i18n import _LI
from neutron.common import constants as n_const
from neutron.extensions import portbindings
from neutron.plugins.common import constants as p_const
from neutron.plugins.ml2.common import exceptions as ml2_exc
@ -437,8 +436,8 @@ class AristaDriver(driver_api.MechanismDriver):
port_id = orig_port['id']
if (new_host != orig_host and
orig_status == const.PORT_STATUS_ACTIVE and
new_status == const.PORT_STATUS_DOWN):
orig_status == n_const.PORT_STATUS_ACTIVE and
new_status == n_const.PORT_STATUS_DOWN):
LOG.debug("Handling port migration for: %s " % orig_port)
network_id = orig_port['network_id']
tenant_id = orig_port['tenant_id'] or INTERNAL_TENANT_ID
@ -469,8 +468,8 @@ class AristaDriver(driver_api.MechanismDriver):
new_host = context.host
if (new_host != orig_host and
orig_status == const.PORT_STATUS_ACTIVE and
new_status == const.PORT_STATUS_DOWN):
orig_status == n_const.PORT_STATUS_ACTIVE and
new_status == n_const.PORT_STATUS_DOWN):
self._try_to_release_dynamic_segment(context, migration=True)

Loading…
Cancel
Save