From 19aed83ff10492a988c793a3660db72f290a75b4 Mon Sep 17 00:00:00 2001 From: Boden R Date: Mon, 11 Feb 2019 07:46:27 -0700 Subject: [PATCH] Fix gate issues on master We recently removed nenutron.common.rpc [1] as the rpc module lives in neutron-lib now. This project was missed because I didn't find neutron.common.rpc as an import. This patch switches rpc uses over to neutron-lib. This also addresses an issue where toxenv fails when it encounters a non-empty __pycache__ directory. This adjusts the options passed to find so that it is tolerant of this scenario and allows tox runs to proceed. [1] https://review.openstack.org/#/c/634790/ Change-Id: Ice83f7574f146436e3db045693b530f0cfeda049 --- .../unit/services/bgp/scheduler/test_bgp_dragent_scheduler.py | 4 ++-- .../tests/unit/services/bgp/test_bgp_plugin.py | 2 +- tox.ini | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/neutron_dynamic_routing/tests/unit/services/bgp/scheduler/test_bgp_dragent_scheduler.py b/neutron_dynamic_routing/tests/unit/services/bgp/scheduler/test_bgp_dragent_scheduler.py index 4e7ef994..37180696 100644 --- a/neutron_dynamic_routing/tests/unit/services/bgp/scheduler/test_bgp_dragent_scheduler.py +++ b/neutron_dynamic_routing/tests/unit/services/bgp/scheduler/test_bgp_dragent_scheduler.py @@ -88,7 +88,7 @@ class TestSchedulerCallback(TestBgpDrAgentSchedulerBaseTestCase): 'agentnotifiers.bgp_dr_rpc_agent_api.' 'BgpDrAgentNotifyApi') bgp_notify_p.start() - rpc_conn_p = mock.patch('neutron.common.rpc.Connection') + rpc_conn_p = mock.patch('neutron_lib.rpc.Connection') rpc_conn_p.start() self.plugin = bgp_plugin.BgpPlugin() self.scheduler = bgp_dras.ChanceScheduler() @@ -299,7 +299,7 @@ class TestRescheduleBgpSpeaker(TestBgpDrAgentSchedulerBaseTestCase, 'agentnotifiers.bgp_dr_rpc_agent_api.' 'BgpDrAgentNotifyApi') bgp_notify_p.start() - rpc_conn_p = mock.patch('neutron.common.rpc.Connection') + rpc_conn_p = mock.patch('neutron_lib.rpc.Connection') rpc_conn_p.start() self.plugin = bgp_plugin.BgpPlugin() self.scheduler = bgp_dras.ChanceScheduler() diff --git a/neutron_dynamic_routing/tests/unit/services/bgp/test_bgp_plugin.py b/neutron_dynamic_routing/tests/unit/services/bgp/test_bgp_plugin.py index 2ddaed18..03b4a87a 100644 --- a/neutron_dynamic_routing/tests/unit/services/bgp/test_bgp_plugin.py +++ b/neutron_dynamic_routing/tests/unit/services/bgp/test_bgp_plugin.py @@ -34,7 +34,7 @@ class TestBgpPlugin(base.BaseTestCase): 'agentnotifiers.bgp_dr_rpc_agent_api.' 'BgpDrAgentNotifyApi') bgp_notify_p.start() - rpc_conn_p = mock.patch('neutron.common.rpc.Connection') + rpc_conn_p = mock.patch('neutron_lib.rpc.Connection') rpc_conn_p.start() admin_ctx_p = mock.patch('neutron_lib.context.get_admin_context') self.admin_ctx_m = admin_ctx_p.start() diff --git a/tox.ini b/tox.ini index e79f3e62..13ddd33f 100644 --- a/tox.ini +++ b/tox.ini @@ -19,7 +19,7 @@ whitelist_externals = sh commands = find . -type f -name "*.py[c|o]" -delete - find . -type d -name "__pycache__" -delete + find . -depth -path "*/__pycache__*" -delete stestr run {posargs} # there is also secret magic in stestr which lets you run in a fail only # mode. To do this define the TRACE_FAILONLY environmental variable.