Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Merge "use db utils from lib"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and openstack-gerrit committed Jul 9, 2018
2 parents fdfb2ff + caca460 commit 031cde2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Expand Up @@ -16,7 +16,7 @@ keystoneauth1>=3.4.0 # Apache-2.0
keystonemiddleware>=4.17.0 # Apache-2.0
netaddr>=0.7.18 # BSD
netifaces>=0.10.4 # MIT
neutron-lib>=1.14.0 # Apache-2.0
neutron-lib>=1.16.0 # Apache-2.0
retrying!=1.3.0,>=1.2.3 # Apache-2.0
SQLAlchemy!=1.1.5,!=1.1.6,!=1.1.7,!=1.1.8,>=1.0.10 # MIT
WebOb>=1.7.1 # MIT
Expand Down
16 changes: 12 additions & 4 deletions tricircle/tests/unit/network/test_central_plugin.py
Expand Up @@ -25,6 +25,7 @@
from neutron_lib.api.definitions import portbindings
from neutron_lib.api.definitions import provider_net
import neutron_lib.constants as q_constants
from neutron_lib.db import utils as lib_db_utils
import neutron_lib.exceptions as q_lib_exc
from neutron_lib.exceptions import availability_zone as az_exc
from neutron_lib.plugins import constants as plugin_constants
Expand Down Expand Up @@ -72,6 +73,13 @@
import tricircle.tests.unit.utils as test_utils
from tricircle.xjob import xmanager


# TODO(boden): remove when https://review.openstack.org/#/c/565593/ lands
if hasattr(_utils, 'filter_non_model_columns'):
db_utils = _utils
else:
db_utils = lib_db_utils

_resource_store = test_utils.get_resource_store()
TOP_NETS = _resource_store.TOP_NETWORKS
TOP_SUBNETS = _resource_store.TOP_SUBNETS
Expand Down Expand Up @@ -1951,7 +1959,7 @@ def test_update_subnet_enable_disable_dhcp(self, mock_context):
'_update_ips_for_port', new=fake_update_ips_for_port)
@patch.object(directory, 'get_plugin', new=fake_get_plugin)
@patch.object(driver.Pool, 'get_instance', new=fake_get_instance)
@patch.object(_utils, 'filter_non_model_columns',
@patch.object(db_utils, 'filter_non_model_columns',
new=fake_filter_non_model_columns)
@patch.object(context, 'get_context_from_neutron_context')
def test_update_port(self, mock_context):
Expand Down Expand Up @@ -2037,7 +2045,7 @@ def test_update_port(self, mock_context):

@patch.object(directory, 'get_plugin', new=fake_get_plugin)
@patch.object(driver.Pool, 'get_instance', new=fake_get_instance)
@patch.object(_utils, 'filter_non_model_columns',
@patch.object(db_utils, 'filter_non_model_columns',
new=fake_filter_non_model_columns)
@patch.object(context, 'get_context_from_neutron_context')
def test_update_bound_port_mac(self, mock_context):
Expand Down Expand Up @@ -2066,7 +2074,7 @@ def test_update_bound_port_mac(self, mock_context):

@patch.object(directory, 'get_plugin', new=fake_get_plugin)
@patch.object(driver.Pool, 'get_instance', new=fake_get_instance)
@patch.object(_utils, 'filter_non_model_columns',
@patch.object(db_utils, 'filter_non_model_columns',
new=fake_filter_non_model_columns)
@patch.object(context, 'get_context_from_neutron_context')
def test_update_non_vm_port(self, mock_context):
Expand Down Expand Up @@ -2103,7 +2111,7 @@ def test_update_non_vm_port(self, mock_context):

@patch.object(FakeRPCAPI, 'setup_shadow_ports')
@patch.object(driver.Pool, 'get_instance', new=fake_get_instance)
@patch.object(_utils, 'filter_non_model_columns',
@patch.object(db_utils, 'filter_non_model_columns',
new=fake_filter_non_model_columns)
@patch.object(context, 'get_context_from_neutron_context')
def test_update_vm_port(self, mock_context, mock_setup):
Expand Down

0 comments on commit 031cde2

Please sign in to comment.