Adapting networking-l2gw to use ovsdbapp library

* Fixing imports according to ovsdbapp

Change-Id: Idee212194c5bf94dde827082a5637705efda1fb9
Signed-off-by: Ricardo Noriega <rnoriega@redhat.com>
Ricardo Noriega 6 years ago
parent 2518685a5b
commit 31b6b610cd

@ -12,7 +12,7 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from neutron.agent.ovsdb.impl_idl import Transaction
from ovsdbapp.backend.ovs_idl.transaction import Transaction
from networking_l2gw.services.l2gateway.agent.ovsdb import api
from networking_l2gw.services.l2gateway.agent.ovsdb.native import (

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from neutron.agent.ovsdb.native import commands as comm
from ovsdbapp.backend.ovs_idl import command as comm
class ListPhysicalSwitchCommand(comm.BaseCommand):

@ -14,13 +14,10 @@
# under the License.
import os
import threading
from ovs.db import idl
from ovs import poller
from neutron.agent.ovsdb.native import connection as conn
from neutron.agent.ovsdb.native import idlutils
from ovsdbapp.backend.ovs_idl import connection as conn
def get_schema_helper_for_vtep():
@ -30,23 +27,5 @@ def get_schema_helper_for_vtep():
class Connection(conn.Connection):
def __init__(self, connection, timeout, schema_name):
super(Connection, self).__init__(connection, timeout, schema_name)
def start(self, table_name_list=None):
with self.lock:
if self.idl is not None:
return
helper = get_schema_helper_for_vtep()
if table_name_list is None:
helper.register_all()
else:
for table_name in table_name_list:
helper.register_table(table_name)
self.idl = idl.Idl(self.connection, helper)
idlutils.wait_for_change(self.idl, self.timeout)
self.poller = poller.Poller()
self.thread = threading.Thread(target=self.run)
self.thread.setDaemon(True)
self.thread.start()
idl_ = idl.Idl(connection, get_schema_helper_for_vtep())
super(Connection, self).__init__(idl_, timeout)

@ -17,9 +17,9 @@ import mock
from mock import MagicMock
import ovs.jsonrpc
from neutron.agent.ovsdb.native import commands as cmd
from neutron.agent.ovsdb.native import idlutils
from neutron.tests import base
from ovsdbapp.backend.ovs_idl import command as cmd
from ovsdbapp.backend.ovs_idl import idlutils
from networking_l2gw.services.l2gateway.agent.ovsdb import impl_idl

@ -6,3 +6,4 @@ pbr!=2.1.0,>=2.0.0 # Apache-2.0
Babel!=2.4.0,>=2.3.4 # BSD
neutron-lib>=1.6.0 # Apache-2.0
python-neutronclient>=5.1.0 # Apache-2.0
ovsdbapp>=0.4.0 # Apache-2.0

Loading…
Cancel
Save