From 06dc45d27324d5fbe05d329244be0b65621c62fb Mon Sep 17 00:00:00 2001 From: Assaf Muller Date: Fri, 29 Aug 2014 14:44:10 +0300 Subject: [PATCH] Fix state_path in tests cfg.CONF.state_path is set to a random temporary directory in neutron.tests.base:BaseTestCase.setUp. This value was then over written in neutron.tests.unit.__init__. Tests that need to read or pass cfg.CONF.state_path were getting the directory from which the tests were running and not the temporary directory specially created for the current test run. Note that the usage of state_path to set lock_path, dhcp state path and the likes was working as expected, and was not affected by this bug. Closes-Bug: #1363058 Change-Id: Ib45f663fadaf0f3b4a79a0db4128822187b61ecc --- neutron/tests/unit/__init__.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/neutron/tests/unit/__init__.py b/neutron/tests/unit/__init__.py index 282187de4..3e3c66c01 100644 --- a/neutron/tests/unit/__init__.py +++ b/neutron/tests/unit/__init__.py @@ -13,12 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -import os - from oslo.config import cfg -reldir = os.path.join(os.path.dirname(__file__), '..', '..', '..') -absdir = os.path.abspath(reldir) -cfg.CONF.state_path = absdir cfg.CONF.use_stderr = False