Merge "Switch to use directly ovsdbapp.api module"

This commit is contained in:
Zuul 2018-01-17 20:31:31 +00:00 committed by Gerrit Code Review
commit 641501da01
3 changed files with 6 additions and 13 deletions

View File

@ -15,20 +15,11 @@
import collections import collections
import uuid import uuid
from debtcollector import moves
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import importutils from oslo_utils import importutils
from ovsdbapp import api
from ovsdbapp import exceptions
from neutron.conf.agent import ovsdb_api from neutron.conf.agent import ovsdb_api
API = moves.moved_class(api.API, 'API', __name__)
Command = moves.moved_class(api.Command, 'Command', __name__)
Transaction = moves.moved_class(api.Transaction, 'Transaction', __name__)
TimeoutException = moves.moved_class(exceptions.TimeoutException,
'TimeoutException', __name__)
ovsdb_api.register_ovsdb_api_opts() ovsdb_api.register_ovsdb_api_opts()

View File

@ -20,6 +20,7 @@ from oslo_log import log as logging
from oslo_serialization import jsonutils from oslo_serialization import jsonutils
from oslo_utils import excutils from oslo_utils import excutils
from oslo_utils import uuidutils from oslo_utils import uuidutils
from ovsdbapp import api as ovsdb_api
import six import six
from neutron.agent.common import utils from neutron.agent.common import utils
@ -32,7 +33,7 @@ def api_factory(context):
return OvsdbVsctl(context) return OvsdbVsctl(context)
class Transaction(ovsdb.Transaction): class Transaction(ovsdb_api.Transaction):
def __init__(self, context, check_error=False, log_errors=True, opts=None): def __init__(self, context, check_error=False, log_errors=True, opts=None):
self.context = context self.context = context
self.check_error = check_error self.check_error = check_error
@ -76,7 +77,7 @@ class Transaction(ovsdb.Transaction):
ctxt.reraise = False ctxt.reraise = False
class BaseCommand(ovsdb.Command): class BaseCommand(ovsdb_api.Command):
def __init__(self, context, cmd, opts=None, args=None): def __init__(self, context, cmd, opts=None, args=None):
self.context = context self.context = context
self.cmd = cmd self.cmd = cmd
@ -180,7 +181,7 @@ class BrExistsCommand(DbCommand):
log_errors=False) log_errors=False)
class OvsdbVsctl(ovsdb.API): class OvsdbVsctl(ovsdb_api.API):
def __init__(self, context): def __init__(self, context):
super(OvsdbVsctl, self).__init__() super(OvsdbVsctl, self).__init__()
self.context = context self.context = context

View File

@ -66,7 +66,8 @@ class LoggingExtensionTestFramework(test_firewall.BaseFirewallTestCase):
int_br = ovs_ext_api.OVSCookieBridge(ovs_bridge.OVSAgentBridge( int_br = ovs_ext_api.OVSCookieBridge(ovs_bridge.OVSAgentBridge(
self.tester.bridge.br_name)) self.tester.bridge.br_name))
mock.patch('ryu.base.app_manager.AppManager.get_instance').start() mock.patch('ryu.base.app_manager.AppManager.get_instance').start()
mock.patch('neutron.agent.ovsdb.api.API.transaction').start() mock.patch(
'neutron.agent.ovsdb.impl_vsctl.OvsdbVsctl.transaction').start()
log_driver = ovs_fw_log.OVSFirewallLoggingDriver(int_br) log_driver = ovs_fw_log.OVSFirewallLoggingDriver(int_br)
log_driver.initialize(self.resource_rpc) log_driver.initialize(self.resource_rpc)
return log_driver return log_driver