Capitalize D in OpenDaylight

The usage of "Opendaylight" and "OpenDaylight" is mixed all along the
project. This commit unifies both into the one with uppercase 'D'.

Change-Id: I7b53d4306516649014005aa1f2be0660cce0bdb4
This commit is contained in:
Juan Vidal
2017-07-06 10:56:36 +02:00
parent 5ccb48fad8
commit b8b40839f5
37 changed files with 111 additions and 111 deletions

View File

@@ -240,14 +240,14 @@ function start_opendaylight {
$ODL_DIR/$ODL_NAME/bin/start
if [ -n "$ODL_BOOT_WAIT_URL" ]; then
echo "Waiting for Opendaylight to start via $ODL_BOOT_WAIT_URL ..."
echo "Waiting for OpenDaylight to start via $ODL_BOOT_WAIT_URL ..."
# Probe ODL restconf for netvirt until it is operational
local testcmd="curl -o /dev/null --fail --silent --head -u \
${ODL_USERNAME}:${ODL_PASSWORD} http://${ODL_MGR_HOST}:${ODL_PORT}/${ODL_BOOT_WAIT_URL}"
test_with_retry "$testcmd" "Opendaylight did not start after $ODL_BOOT_WAIT" \
test_with_retry "$testcmd" "OpenDaylight did not start after $ODL_BOOT_WAIT" \
$ODL_BOOT_WAIT $ODL_RETRY_SLEEP_INTERVAL
else
echo "Waiting for Opendaylight to start ..."
echo "Waiting for OpenDaylight to start ..."
# Sleep a bit to let OpenDaylight finish starting up
sleep $ODL_BOOT_WAIT
fi

View File

@@ -1,15 +1,15 @@
# Devstack settings
# Each service you enable has the following meaning:
# odl-neutron - Add this config flag if Opendaylight controller and OpenStack
# odl-neutron - Add this config flag if OpenDaylight controller and OpenStack
# Controller are on different nodes.
# odl-server - Add this config flag if Opendaylight controller and OpenStack
# odl-server - Add this config flag if OpenDaylight controller and OpenStack
# Controller are on the same node.
# odl-compute - Add this config flag for OpenStack Compute.
#
# odl-lightweight-testing - Add this config flag for testing neutron ODL ML2
# driver and networking-odl without a real running
# Opendaylight instance
# OpenDaylight instance
#
# NOTE: odl-server includes odl-neutron.
#
@@ -39,7 +39,7 @@ ODL_MODE=${ODL_MODE:-allinone}
#
# ODL_MODE=lightweight-testing
# Use this for testing neutron ML2 driver plus networking-odl without
# a running Opendaylight instance.
# a running OpenDaylight instance.
#
# ODL_MODE=manual
# You're on your own here, and are enabling services outside the scope of

View File

@@ -104,7 +104,7 @@ recommended to enable the create_opendaylight_dhcp_port flag for the networking
Alternative 1
--------------
The creation of Neutron Opendaylight DHCP port will be invoked within the
The creation of Neutron OpenDaylight DHCP port will be invoked within the
OpenDaylight mechanism Driver subnet-postcommit execution.
Any failures during the neutron dhcp port creation or allocation for the subnet

View File

@@ -43,7 +43,7 @@ class OpenDaylightBgpvpnDriver(driver_api.BGPVPNDriver):
def __init__(self, service_plugin):
LOG.info("Initializing OpenDaylight BGPVPN v2 driver")
super(OpenDaylightBgpvpnDriver, self).__init__(service_plugin)
self.journal = journal.OpendaylightJournalThread()
self.journal = journal.OpenDaylightJournalThread()
@log_helpers.log_method_call
def create_bgpvpn_precommit(self, context, bgpvpn):

View File

@@ -43,8 +43,8 @@ ODL_WEBSOCKET_CONNECTING = "ODL_WEBSOCKET_CONNECTING"
ODL_WEBSOCKET_CONNECTED = "ODL_WEBSOCKET_CONNECTED"
class OpendaylightWebsocketClient(object):
"""Thread for the Opendaylight Websocket """
class OpenDaylightWebsocketClient(object):
"""Thread for the OpenDaylight Websocket """
def __init__(self, odl_rest_client, path, datastore, scope, leaf_node_only,
packet_handler, timeout, status_cb=None):

View File

@@ -32,28 +32,28 @@ LOG = logging.getLogger(__name__)
def check_for_pending_or_processing_ops(session, object_uuid, seqnum=None,
operation=None):
q = session.query(models.OpendaylightJournal).filter(
or_(models.OpendaylightJournal.state == odl_const.PENDING,
models.OpendaylightJournal.state == odl_const.PROCESSING),
models.OpendaylightJournal.object_uuid == object_uuid)
q = session.query(models.OpenDaylightJournal).filter(
or_(models.OpenDaylightJournal.state == odl_const.PENDING,
models.OpenDaylightJournal.state == odl_const.PROCESSING),
models.OpenDaylightJournal.object_uuid == object_uuid)
if seqnum is not None:
q = q.filter(models.OpendaylightJournal.seqnum < seqnum)
q = q.filter(models.OpenDaylightJournal.seqnum < seqnum)
if operation:
if isinstance(operation, (list, tuple)):
q = q.filter(models.OpendaylightJournal.operation.in_(operation))
q = q.filter(models.OpenDaylightJournal.operation.in_(operation))
else:
q = q.filter(models.OpendaylightJournal.operation == operation)
q = q.filter(models.OpenDaylightJournal.operation == operation)
return session.query(q.exists()).scalar()
def check_for_pending_delete_ops_with_parent(session, object_type, parent_id):
rows = session.query(models.OpendaylightJournal).filter(
or_(models.OpendaylightJournal.state == odl_const.PENDING,
models.OpendaylightJournal.state == odl_const.PROCESSING),
models.OpendaylightJournal.object_type == object_type,
models.OpendaylightJournal.operation == odl_const.ODL_DELETE
rows = session.query(models.OpenDaylightJournal).filter(
or_(models.OpenDaylightJournal.state == odl_const.PENDING,
models.OpenDaylightJournal.state == odl_const.PROCESSING),
models.OpenDaylightJournal.object_type == object_type,
models.OpenDaylightJournal.operation == odl_const.ODL_DELETE
).all()
for row in rows:
@@ -64,12 +64,12 @@ def check_for_pending_delete_ops_with_parent(session, object_type, parent_id):
def check_for_older_ops(session, row):
q = session.query(models.OpendaylightJournal).filter(
or_(models.OpendaylightJournal.state == odl_const.PENDING,
models.OpendaylightJournal.state == odl_const.PROCESSING),
models.OpendaylightJournal.operation == row.operation,
models.OpendaylightJournal.object_uuid == row.object_uuid,
models.OpendaylightJournal.seqnum < row.seqnum)
q = session.query(models.OpenDaylightJournal).filter(
or_(models.OpenDaylightJournal.state == odl_const.PENDING,
models.OpenDaylightJournal.state == odl_const.PROCESSING),
models.OpenDaylightJournal.operation == row.operation,
models.OpenDaylightJournal.object_uuid == row.object_uuid,
models.OpenDaylightJournal.seqnum < row.seqnum)
row = q.first()
if row is not None:
LOG.debug("found older operation %s", row)
@@ -77,11 +77,11 @@ def check_for_older_ops(session, row):
def get_all_db_rows(session):
return session.query(models.OpendaylightJournal).all()
return session.query(models.OpenDaylightJournal).all()
def get_all_db_rows_by_state(session, state):
return session.query(models.OpendaylightJournal).filter_by(
return session.query(models.OpenDaylightJournal).filter_by(
state=state).all()
@@ -92,9 +92,9 @@ def get_all_db_rows_by_state(session, state):
@db_api.retry_db_errors
def get_oldest_pending_db_row_with_lock(session):
with session.begin():
row = session.query(models.OpendaylightJournal).filter_by(
row = session.query(models.OpenDaylightJournal).filter_by(
state=odl_const.PENDING).order_by(
asc(models.OpendaylightJournal.last_retried)).with_for_update(
asc(models.OpenDaylightJournal.last_retried)).with_for_update(
).first()
if row:
update_db_row_state(session, row, odl_const.PROCESSING)
@@ -122,7 +122,7 @@ def update_pending_db_row_retry(session, row, retry_count):
@oslo_db_api.wrap_db_retry(max_retries=db_api.MAX_RETRIES)
def delete_row(session, row=None, row_id=None):
if row_id:
row = session.query(models.OpendaylightJournal).filter_by(
row = session.query(models.OpenDaylightJournal).filter_by(
id=row_id).one()
if row:
session.delete(row)
@@ -132,7 +132,7 @@ def delete_row(session, row=None, row_id=None):
@oslo_db_api.wrap_db_retry(max_retries=db_api.MAX_RETRIES)
def create_pending_row(session, object_type, object_uuid,
operation, data):
row = models.OpendaylightJournal(object_type=object_type,
row = models.OpenDaylightJournal(object_type=object_type,
object_uuid=object_uuid,
operation=operation, data=data,
created_at=func.now(),
@@ -146,9 +146,9 @@ def create_pending_row(session, object_type, object_uuid,
@db_api.retry_db_errors
def delete_pending_rows(session, operations_to_delete):
with session.begin():
session.query(models.OpendaylightJournal).filter(
models.OpendaylightJournal.operation.in_(operations_to_delete),
models.OpendaylightJournal.state == odl_const.PENDING).delete(
session.query(models.OpenDaylightJournal).filter(
models.OpenDaylightJournal.operation.in_(operations_to_delete),
models.OpenDaylightJournal.state == odl_const.PENDING).delete(
synchronize_session=False)
session.expire_all()
@@ -156,7 +156,7 @@ def delete_pending_rows(session, operations_to_delete):
@db_api.retry_db_errors
def _update_maintenance_state(session, expected_state, state):
with session.begin():
row = session.query(models.OpendaylightMaintenance).filter_by(
row = session.query(models.OpenDaylightMaintenance).filter_by(
state=expected_state).with_for_update().one_or_none()
if row is None:
return False
@@ -186,16 +186,16 @@ def update_maintenance_operation(session, operation=None):
op_text = operation.__name__
with session.begin():
row = session.query(models.OpendaylightMaintenance).one_or_none()
row = session.query(models.OpenDaylightMaintenance).one_or_none()
row.processing_operation = op_text
def delete_rows_by_state_and_time(session, state, time_delta):
with session.begin():
now = session.execute(func.now()).scalar()
session.query(models.OpendaylightJournal).filter(
models.OpendaylightJournal.state == state,
models.OpendaylightJournal.last_retried < now - time_delta).delete(
session.query(models.OpenDaylightJournal).filter(
models.OpenDaylightJournal.state == state,
models.OpenDaylightJournal.last_retried < now - time_delta).delete(
synchronize_session=False)
session.expire_all()
@@ -204,9 +204,9 @@ def reset_processing_rows(session, max_timedelta):
with session.begin():
now = session.execute(func.now()).scalar()
max_timedelta = datetime.timedelta(seconds=max_timedelta)
rows = session.query(models.OpendaylightJournal).filter(
models.OpendaylightJournal.last_retried < now - max_timedelta,
models.OpendaylightJournal.state == odl_const.PROCESSING,
rows = session.query(models.OpenDaylightJournal).filter(
models.OpenDaylightJournal.last_retried < now - max_timedelta,
models.OpenDaylightJournal.state == odl_const.PROCESSING,
).update({'state': odl_const.PENDING})
return rows

View File

@@ -13,7 +13,7 @@
# under the License.
#
"""Opendaylight Neutron mechanism driver refactor
"""OpenDaylight Neutron mechanism driver refactor
Revision ID: 37e242787ae5
Revises: 247501328046

View File

@@ -21,7 +21,7 @@ from neutron_lib.db import model_base
from networking_odl.common import constants as odl_const
class OpendaylightJournal(model_base.BASEV2):
class OpenDaylightJournal(model_base.BASEV2):
__tablename__ = 'opendaylightjournal'
seqnum = sa.Column(sa.BigInteger().with_variant(sa.Integer(), 'sqlite'),
@@ -42,7 +42,7 @@ class OpendaylightJournal(model_base.BASEV2):
onupdate=sa.func.now())
class OpendaylightMaintenance(model_base.BASEV2, model_base.HasId):
class OpenDaylightMaintenance(model_base.BASEV2, model_base.HasId):
__tablename__ = 'opendaylight_maintenance'
state = sa.Column(sa.Enum(odl_const.PENDING, odl_const.PROCESSING),

View File

@@ -88,8 +88,8 @@ def record(plugin_context, object_type, object_uuid, operation, data,
operation, data)
class OpendaylightJournalThread(object):
"""Thread worker for the Opendaylight Journal Database."""
class OpenDaylightJournalThread(object):
"""Thread worker for the OpenDaylight Journal Database."""
def __init__(self):
self.client = client.OpenDaylightRestClient.create_client()
self._odl_sync_timeout = cfg.CONF.ml2_odl.sync_timeout

View File

@@ -31,7 +31,7 @@ L2GATEWAY_CONNECTIONS = 'l2gateway-connections'
class OpenDaylightL2gwDriver(service_drivers.L2gwDriver):
"""Opendaylight L2Gateway Service Driver
"""OpenDaylight L2Gateway Service Driver
This code is the openstack driver for exciting the OpenDaylight L2GW
facility.

View File

@@ -33,7 +33,7 @@ LOG = logging.getLogger(__name__)
@postcommit.add_postcommit('l2_gateway', 'l2_gateway_connection')
class OpenDaylightL2gwDriver(service_drivers.L2gwDriver):
"""Opendaylight L2Gateway Service Driver
"""OpenDaylight L2Gateway Service Driver
This code is the openstack driver for exciting the OpenDaylight L2GW
facility.
@@ -42,7 +42,7 @@ class OpenDaylightL2gwDriver(service_drivers.L2gwDriver):
def __init__(self, service_plugin, validator=None):
super(OpenDaylightL2gwDriver, self).__init__(service_plugin, validator)
self.service_plugin = service_plugin
self.journal = journal.OpendaylightJournalThread()
self.journal = journal.OpenDaylightJournalThread()
LOG.info("ODL: Started OpenDaylight L2Gateway V2 driver")
@property

View File

@@ -53,7 +53,7 @@ class OpenDaylightL3RouterPlugin(
# TODO(rcurran): Continue investigation into how many journal threads
# to run per neutron controller deployment.
self.journal = journal.OpendaylightJournalThread()
self.journal = journal.OpenDaylightJournalThread()
def get_plugin_type(self):
return plugin_constants.L3

View File

@@ -38,7 +38,7 @@ class OpenDaylightManager(driver_base.LoadBalancerBaseDriver):
def __init__(self, driver, obj_type):
LOG.debug("Initializing OpenDaylight LBaaS driver")
super(OpenDaylightManager, self).__init__(driver)
self.journal = journal.OpendaylightJournalThread()
self.journal = journal.OpenDaylightJournalThread()
self.obj_type = obj_type
def _journal_record(self, context, obj_type, obj_id, operation, obj):

View File

@@ -54,7 +54,7 @@ class OpenDaylightMechanismDriver(api.MechanismDriver):
self.sg_handler = callback.OdlSecurityGroupsHandler(
self.sync_from_callback_precommit,
self.sync_from_callback_postcommit)
self.journal = journal.OpendaylightJournalThread()
self.journal = journal.OpenDaylightJournalThread()
self.port_binding_controller = port_binding.PortBindingManager.create()
self.trunk_driver = trunk_driver.OpenDaylightTrunkDriverV2.create()
if odl_const.ODL_QOS in cfg.CONF.ml2.extension_drivers:

View File

@@ -57,13 +57,13 @@ class OdlPortStatusUpdate(worker.BaseWorker):
pass
def run_websocket(self):
# Opendaylight path to recieve websocket notifications on
# OpenDaylight path to recieve websocket notifications on
neutron_ports_path = "/neutron:neutron/neutron:ports"
self.path_uri = utils.get_odl_url()
self.odl_websocket_client = (
odl_ws_client.OpendaylightWebsocketClient.odl_create_websocket(
odl_ws_client.OpenDaylightWebsocketClient.odl_create_websocket(
self.path_uri, neutron_ports_path,
odl_ws_client.ODL_OPERATIONAL_DATASTORE,
odl_ws_client.ODL_NOTIFICATION_SCOPE_SUBTREE,

View File

@@ -109,7 +109,7 @@ class PseudoAgentDBBindingController(port_binding.PortBindingController):
response.raise_for_status()
hostconfigs = response.json()['hostconfigs']['hostconfig']
except exceptions.ConnectionError:
LOG.error("Cannot connect to the Opendaylight Controller",
LOG.error("Cannot connect to the OpenDaylight Controller",
exc_info=True)
return None
except exceptions.HTTPError as e:
@@ -321,11 +321,11 @@ class PseudoAgentDBBindingController(port_binding.PortBindingController):
return network_type in conf['allowed_network_types']
def _start_websocket(self, odl_url):
# Opendaylight path to recieve websocket notifications on
# OpenDaylight path to recieve websocket notifications on
neutron_hostconfigs_path = """/neutron:neutron/neutron:hostconfigs"""
self.odl_websocket_client = (
odl_ws_client.OpendaylightWebsocketClient.odl_create_websocket(
odl_ws_client.OpenDaylightWebsocketClient.odl_create_websocket(
odl_url, neutron_hostconfigs_path,
odl_ws_client.ODL_OPERATIONAL_DATASTORE,
odl_ws_client.ODL_NOTIFICATION_SCOPE_SUBTREE,

View File

@@ -45,7 +45,7 @@ class OpenDaylightQosDriver(base.DriverBase):
"""OpenDaylight QOS Driver
This code is backend implementation for Opendaylight Qos
This code is backend implementation for OpenDaylight Qos
driver for Openstack Neutron.
"""
@@ -62,7 +62,7 @@ class OpenDaylightQosDriver(base.DriverBase):
name, vif_types, vnic_types, supported_rules,
requires_rpc_notifications)
LOG.debug("Initializing OpenDaylight Qos driver")
self.journal = journal.OpendaylightJournalThread()
self.journal = journal.OpenDaylightJournalThread()
def _record_in_journal(self, context, op_const, qos_policy):
data = qos_utils.convert_rules_format(qos_policy.to_dict())

View File

@@ -39,7 +39,7 @@ class OpenDaylightSFCFlowClassifierDriverV2(
def initialize(self):
LOG.debug("Initializing OpenDaylight Networking "
"SFC Flow Classifier driver Version 2")
self.journal = journal.OpendaylightJournalThread()
self.journal = journal.OpenDaylightJournalThread()
@staticmethod
def _record_in_journal(context, object_type, operation, data=None):

View File

@@ -37,7 +37,7 @@ class OpenDaylightSFCDriverV2(sfc_driver.SfcDriverBase):
def initialize(self):
LOG.debug("Initializing OpenDaylight Networking SFC driver(Version 2)")
self.journal = journal.OpendaylightJournalThread()
self.journal = journal.OpenDaylightJournalThread()
@staticmethod
def _record_in_journal(context, object_type, operation, data=None):

View File

@@ -57,9 +57,9 @@ class OpenDaylightRestClientGlobalFixture(fixtures.Fixture):
mock.patch.object(self._global_client, 'get_client').start()
class OpendaylightFeaturesFixture(fixtures.Fixture):
class OpenDaylightFeaturesFixture(fixtures.Fixture):
def _setUp(self):
super(OpendaylightFeaturesFixture, self)._setUp()
super(OpenDaylightFeaturesFixture, self)._setUp()
if cfg.CONF.ml2_odl.url is None:
cfg.CONF.set_override('url', 'http://127.0.0.1:9999', 'ml2_odl')
if cfg.CONF.ml2_odl.username is None:

View File

@@ -36,10 +36,10 @@ class OpenDaylightConfigBase(test_plugin.Ml2PluginV2TestCase,
cfg.CONF.set_override('extension_drivers',
['port_security', 'qos'], 'ml2')
self.mock_sync_thread = mock.patch.object(
journal.OpendaylightJournalThread, 'start_odl_sync_thread').start()
journal.OpenDaylightJournalThread, 'start_odl_sync_thread').start()
self.mock_mt_thread = mock.patch.object(
maintenance.MaintenanceThread, 'start').start()
self.thread = journal.OpendaylightJournalThread()
self.thread = journal.OpenDaylightJournalThread()
def run_journal_processing(self):
"""Cause the journal to process the first pending entry"""

View File

@@ -24,10 +24,10 @@ from networking_odl.db import db
from networking_odl.tests.unit import base_v2
class OpendaylightBgpvpnDriverTestCase(base_v2.OpenDaylightConfigBase):
class OpenDaylightBgpvpnDriverTestCase(base_v2.OpenDaylightConfigBase):
def setUp(self):
super(OpendaylightBgpvpnDriverTestCase, self).setUp()
super(OpenDaylightBgpvpnDriverTestCase, self).setUp()
self.db_session = neutron_db_api.get_reader_session()
self.driver = driverv2.OpenDaylightBgpvpnDriver(service_plugin=None)
self.context = self._get_mock_context()

View File

@@ -33,7 +33,7 @@ class TestOdlFeatures(base.DietTestCase):
def setUp(self):
super(TestOdlFeatures, self).setUp()
self.features_fixture = base.OpendaylightFeaturesFixture()
self.features_fixture = base.OpenDaylightFeaturesFixture()
self.useFixture(self.features_fixture)
self.features_fixture.mock_odl_features_init.stop()

View File

@@ -50,10 +50,10 @@ class TestWebsocketClient(base.DietTestCase):
"""Setup test."""
super(TestWebsocketClient, self).setUp()
self.useFixture(base.OpenDaylightRestClientFixture())
mock.patch.object(wsc.OpendaylightWebsocketClient,
mock.patch.object(wsc.OpenDaylightWebsocketClient,
'start_odl_websocket_thread').start()
self.mgr = wsc.OpendaylightWebsocketClient.odl_create_websocket(
self.mgr = wsc.OpenDaylightWebsocketClient.odl_create_websocket(
"http://localhost:8080/",
"restconf/operational/neutron:neutron/hostconfigs",
wsc.ODL_OPERATIONAL_DATASTORE, wsc.ODL_NOTIFICATION_SCOPE_SUBTREE,

View File

@@ -203,13 +203,13 @@ class DbTestCase(test_base_db.ODLBaseDbTestCase):
def _test_maintenance_lock_unlock(self, db_func, existing_state,
expected_state, expected_result):
row = models.OpendaylightMaintenance(id='test',
row = models.OpenDaylightMaintenance(id='test',
state=existing_state)
self.db_session.add(row)
self.db_session.flush()
self.assertEqual(expected_result, db_func(self.db_session))
row = self.db_session.query(models.OpendaylightMaintenance).one()
row = self.db_session.query(models.OpenDaylightMaintenance).one()
self.assertEqual(expected_state, row['state'])
def test_lock_maintenance(self):

View File

@@ -27,7 +27,7 @@ class DbTestCase(test_base_db.ODLBaseDbTestCase):
UPDATE_ROW = [odl_const.ODL_NETWORK, 'id', odl_const.ODL_UPDATE,
{'test': 'data'}]
model = models.OpendaylightJournal
model = models.OpenDaylightJournal
def setUp(self):
super(DbTestCase, self).setUp()
@@ -48,7 +48,7 @@ class DbTestCase(test_base_db.ODLBaseDbTestCase):
row = self._create_row()
# NOTE(manjeets) as seqnum is primary key so there would be
# exactly one row created.
query = self.db_session.query(models.OpendaylightJournal)
query = self.db_session.query(models.OpenDaylightJournal)
got = query.filter_by(seqnum=row.seqnum).one()
self.assertEqual(row, got)

View File

@@ -27,7 +27,7 @@ class MaintenanceThreadTestCase(test_base_db.ODLBaseDbTestCase):
def setUp(self):
super(MaintenanceThreadTestCase, self).setUp()
row = models.OpendaylightMaintenance(state=odl_const.PENDING)
row = models.OpenDaylightMaintenance(state=odl_const.PENDING)
self.db_session.add(row)
self.db_session.flush()

View File

@@ -40,7 +40,7 @@ class RecoveryTestCase(SqlTestCaseLight):
self.addCleanup(self._db_cleanup)
def _db_cleanup(self):
self.db_session.query(models.OpendaylightJournal).delete()
self.db_session.query(models.OpenDaylightJournal).delete()
def _mock_resource(self, plugin, resource_type):
mock_resource = mock.MagicMock()

View File

@@ -24,10 +24,10 @@ from networking_odl.l2gateway import driver_v2 as driverv2
from networking_odl.tests.unit import base_v2
class OpendaylightL2GWDriverTestCase(base_v2.OpenDaylightConfigBase):
class OpenDaylightL2GWDriverTestCase(base_v2.OpenDaylightConfigBase):
def setUp(self):
super(OpendaylightL2GWDriverTestCase, self).setUp()
super(OpenDaylightL2GWDriverTestCase, self).setUp()
self.db_session = neutron_db_api.get_writer_session()
self.driver = driverv2.OpenDaylightL2gwDriver(service_plugin=None)
self.context = self._get_mock_context()

View File

@@ -51,7 +51,7 @@ class OpenDayLightMechanismConfigTests(testlib_api.SqlTestCase):
def setUp(self):
super(OpenDayLightMechanismConfigTests, self).setUp()
self.useFixture(odl_base.OpenDaylightRestClientFixture())
self.useFixture(odl_base.OpendaylightFeaturesFixture())
self.useFixture(odl_base.OpenDaylightFeaturesFixture())
cfg.CONF.set_override('mechanism_drivers',
['logger', 'opendaylight_v2'], 'ml2')
cfg.CONF.set_override('port_binding_controller',
@@ -111,7 +111,7 @@ class OpenDaylightL3TestCase(test_db_base_plugin_v2.NeutronDbPluginV2TestCase,
cfg.CONF.set_override("service_plugins", ['odl-router_v2'])
core_plugin = cfg.CONF.core_plugin
service_plugins = {'l3_plugin_name': 'odl-router_v2'}
mock.patch.object(journal.OpendaylightJournalThread,
mock.patch.object(journal.OpenDaylightJournalThread,
'start_odl_sync_thread').start()
self.mock_mt_thread = mock.patch.object(
maintenance.MaintenanceThread, 'start').start()
@@ -121,14 +121,14 @@ class OpenDaylightL3TestCase(test_db_base_plugin_v2.NeutronDbPluginV2TestCase,
'sync_from_callback_precommit').start()
mock.patch.object(mech_driver_v2.OpenDaylightMechanismDriver,
'sync_from_callback_postcommit').start()
self.useFixture(odl_base.OpendaylightFeaturesFixture())
self.useFixture(odl_base.OpenDaylightFeaturesFixture())
super(OpenDaylightL3TestCase, self).setUp(
plugin=core_plugin, service_plugins=service_plugins)
self.db_session = neutron_db_api.get_writer_session()
self.plugin = directory.get_plugin()
self.plugin._network_is_external = mock.Mock(return_value=True)
self.driver = directory.get_plugin(constants.L3)
self.thread = journal.OpendaylightJournalThread()
self.thread = journal.OpenDaylightJournalThread()
self.driver.get_floatingip = mock.Mock(
return_value={'router_id': ROUTER_ID,
'floating_network_id': NETWORK_ID})

View File

@@ -23,7 +23,7 @@ from networking_odl.lbaas import lbaasv2_driver_v2 as lb_driver
from networking_odl.tests.unit import base_v2
class OpendaylightLBaaSBaseTestCase(base_v2.OpenDaylightConfigBase):
class OpenDaylightLBaaSBaseTestCase(base_v2.OpenDaylightConfigBase):
session = None
@classmethod
@@ -65,7 +65,7 @@ class OpendaylightLBaaSBaseTestCase(base_v2.OpenDaylightConfigBase):
return hm
@mock.patch.object(
networking_odl.journal.journal.OpendaylightJournalThread,
networking_odl.journal.journal.OpenDaylightJournalThread,
'set_sync_event')
@mock.patch.object(neutron_lbaas.drivers.driver_mixins.BaseManagerMixin,
'successful_completion')
@@ -83,7 +83,7 @@ class OpendaylightLBaaSBaseTestCase(base_v2.OpenDaylightConfigBase):
row['object_type'])
class OpendaylightLBaaSDriverTestCase(OpendaylightLBaaSBaseTestCase):
class OpenDaylightLBaaSDriverTestCase(OpenDaylightLBaaSBaseTestCase):
def _test_operation(self, obj_type, operation, op_const):
driver = mock.Mock()
obj_driver = lb_driver.OpenDaylightManager(driver, obj_type)
@@ -91,7 +91,7 @@ class OpendaylightLBaaSDriverTestCase(OpendaylightLBaaSBaseTestCase):
operation, op_const)
class ODLLoadBalancerManagerTestCase(OpendaylightLBaaSBaseTestCase):
class ODLLoadBalancerManagerTestCase(OpenDaylightLBaaSBaseTestCase):
def _test_operation(self, operation, op_const):
driver = mock.Mock()
obj_type = odl_const.ODL_LOADBALANCER
@@ -108,7 +108,7 @@ class ODLLoadBalancerManagerTestCase(OpendaylightLBaaSBaseTestCase):
self._test_operation('delete', odl_const.ODL_DELETE)
class ODLListenerManagerTestCase(OpendaylightLBaaSBaseTestCase):
class ODLListenerManagerTestCase(OpenDaylightLBaaSBaseTestCase):
def _test_operation(self, operation, op_const):
driver = mock.Mock()
obj_type = odl_const.ODL_LISTENER
@@ -125,7 +125,7 @@ class ODLListenerManagerTestCase(OpendaylightLBaaSBaseTestCase):
self._test_operation('delete', odl_const.ODL_DELETE)
class ODLPoolManagerTestCase(OpendaylightLBaaSBaseTestCase):
class ODLPoolManagerTestCase(OpenDaylightLBaaSBaseTestCase):
def _test_operation(self, operation, op_const):
obj_type = odl_const.ODL_POOL
obj = mock.MagicMock()
@@ -142,7 +142,7 @@ class ODLPoolManagerTestCase(OpendaylightLBaaSBaseTestCase):
self._test_operation('delete', odl_const.ODL_DELETE)
class ODLMemberManagerTestCase(OpendaylightLBaaSBaseTestCase):
class ODLMemberManagerTestCase(OpenDaylightLBaaSBaseTestCase):
def _test_operation(self, operation, op_const):
driver = mock.Mock()
obj_type = odl_const.ODL_MEMBER
@@ -159,7 +159,7 @@ class ODLMemberManagerTestCase(OpendaylightLBaaSBaseTestCase):
self._test_operation('delete', odl_const.ODL_DELETE)
class ODLHealthMonitorManagerTestCase(OpendaylightLBaaSBaseTestCase):
class ODLHealthMonitorManagerTestCase(OpenDaylightLBaaSBaseTestCase):
def _test_operation(self, operation, op_const):
driver = mock.Mock()
obj_type = odl_const.ODL_HEALTHMONITOR

View File

@@ -122,7 +122,7 @@ class OpenDaylightTestCase(test_plugin.Ml2PluginV2TestCase):
def setUp(self):
self.useFixture(odl_base.OpenDaylightRestClientFixture())
self.useFixture(odl_base.OpendaylightFeaturesFixture())
self.useFixture(odl_base.OpenDaylightFeaturesFixture())
super(OpenDaylightTestCase, self).setUp()
self.port_create_status = 'DOWN'
self.mech = mech_driver.OpenDaylightMechanismDriver()
@@ -138,7 +138,7 @@ class OpenDaylightTestCase(test_plugin.Ml2PluginV2TestCase):
class OpenDayLightMechanismConfigTests(testlib_api.SqlTestCase):
def setUp(self):
super(OpenDayLightMechanismConfigTests, self).setUp()
self.useFixture(odl_base.OpendaylightFeaturesFixture())
self.useFixture(odl_base.OpenDaylightFeaturesFixture())
config.cfg.CONF.set_override('mechanism_drivers',
['logger', 'opendaylight'],
'ml2')
@@ -304,7 +304,7 @@ class OpenDaylightMechanismDriverTestCase(base.BaseTestCase):
def setUp(self):
super(OpenDaylightMechanismDriverTestCase, self).setUp()
self.useFixture(odl_base.OpenDaylightRestClientFixture())
self.useFixture(odl_base.OpendaylightFeaturesFixture())
self.useFixture(odl_base.OpenDaylightFeaturesFixture())
config.cfg.CONF.set_override('mechanism_drivers',
['logger', 'opendaylight'], 'ml2')
self.mech = mech_driver.OpenDaylightMechanismDriver()
@@ -550,7 +550,7 @@ class OpenDaylightMechanismDriverTestCase(base.BaseTestCase):
class TestOpenDaylightMechanismDriver(base.DietTestCase):
def setUp(self):
self.useFixture(odl_base.OpenDaylightRestClientFixture())
self.useFixture(odl_base.OpendaylightFeaturesFixture())
self.useFixture(odl_base.OpenDaylightFeaturesFixture())
super(TestOpenDaylightMechanismDriver, self).setUp()
config.cfg.CONF.set_override('mechanism_drivers',
['logger', 'opendaylight'], 'ml2')

View File

@@ -60,14 +60,14 @@ class OpenDayLightMechanismConfigTests(testlib_api.SqlTestCase):
def setUp(self):
super(OpenDayLightMechanismConfigTests, self).setUp()
self.mock_sync_thread = mock.patch.object(
journal.OpendaylightJournalThread, 'start_odl_sync_thread').start()
journal.OpenDaylightJournalThread, 'start_odl_sync_thread').start()
self.mock_mt_thread = mock.patch.object(
maintenance.MaintenanceThread, 'start').start()
cfg.CONF.set_override('mechanism_drivers',
['logger', 'opendaylight_v2'], 'ml2')
cfg.CONF.set_override('port_binding_controller',
'legacy-port-binding', 'ml2_odl')
self.useFixture(odl_base.OpendaylightFeaturesFixture())
self.useFixture(odl_base.OpenDaylightFeaturesFixture())
def _set_config(self, url='http://127.0.0.1:9999', username='someuser',
password='somepass'):
@@ -155,7 +155,7 @@ class AttributeDict(dict):
class OpenDaylightMechanismDriverTestCase(base_v2.OpenDaylightConfigBase):
def setUp(self):
super(OpenDaylightMechanismDriverTestCase, self).setUp()
self.useFixture(odl_base.OpendaylightFeaturesFixture())
self.useFixture(odl_base.OpenDaylightFeaturesFixture())
self.db_session = neutron_db_api.get_writer_session()
self.mech = mech_driver_v2.OpenDaylightMechanismDriver()
self.mech.initialize()

View File

@@ -20,7 +20,7 @@ import mock
from networking_odl.common.client import OpenDaylightRestClient
from networking_odl.common import websocket_client as odl_ws_client
from networking_odl.common.websocket_client import OpendaylightWebsocketClient
from networking_odl.common.websocket_client import OpenDaylightWebsocketClient
from networking_odl.ml2.port_status_update import OdlPortStatusUpdate
from networking_odl.tests import base
from neutron.db import provisioning_blocks
@@ -57,9 +57,9 @@ class TestOdlPortStatusUpdate(base.DietTestCase):
def setUp(self):
super(TestOdlPortStatusUpdate, self).setUp()
self.useFixture(base.OpendaylightFeaturesFixture())
self.useFixture(base.OpenDaylightFeaturesFixture())
self.mock_ws_client = mock.patch.object(
OpendaylightWebsocketClient, 'odl_create_websocket')
OpenDaylightWebsocketClient, 'odl_create_websocket')
def test_object_create(self):
OdlPortStatusUpdate()

View File

@@ -23,14 +23,14 @@ from networking_odl.qos import qos_driver_v2 as qos_driver
from networking_odl.tests.unit import base_v2
class OpendaylightQosDriverTestCase(base_v2.OpenDaylightConfigBase):
class OpenDaylightQosDriverTestCase(base_v2.OpenDaylightConfigBase):
def setUp(self):
super(OpendaylightQosDriverTestCase, self).setUp()
super(OpenDaylightQosDriverTestCase, self).setUp()
self.db_session = neutron_db_api.get_session()
self.qos_driver = qos_driver.OpenDaylightQosDriver()
self.mock_sync_thread = mock.patch.object(
journal.OpendaylightJournalThread, 'start_odl_sync_thread').start()
journal.OpenDaylightJournalThread, 'start_odl_sync_thread').start()
def _get_mock_context(self):
current = {'tenant_id': 'tenant_id'}

View File

@@ -28,5 +28,5 @@ class ODLBaseDbTestCase(SqlTestCaseLight):
self.addCleanup(self._db_cleanup)
def _db_cleanup(self):
self.db_session.query(models.OpendaylightJournal).delete()
self.db_session.query(models.OpendaylightMaintenance).delete()
self.db_session.query(models.OpenDaylightJournal).delete()
self.db_session.query(models.OpenDaylightMaintenance).delete()

View File

@@ -35,7 +35,7 @@ LOG = logging.getLogger(__name__)
class OpenDaylightTrunkHandlerV2(object):
def __init__(self):
cfg.CONF.register_opts(odl_conf.odl_opts, "ml2_odl")
self.journal = journal.OpendaylightJournalThread()
self.journal = journal.OpenDaylightJournalThread()
LOG.info('initialized trunk driver for OpendayLight')
@staticmethod