Set OS_TEST_LOCK_PATH default value in fake_config

This commit sets OS_TEST_LOCK_PATH default value in fake_config.
Originally, a 'None' directory was created after a unit test running.
Because we don't specified the environment variable when we run unit
tests. Let's stop making a weird 'None' directory.

Change-Id: I850f0835af821e90d85a9366d0ef87618761216a
This commit is contained in:
Masayuki Igawa 2017-12-08 19:18:59 +09:00
parent 6dd6fc66d8
commit 4778205570
No known key found for this signature in database
GPG Key ID: 290F53EDC899BF89

View File

@ -40,10 +40,12 @@ class ConfigFixture(conf_fixture.Config):
group='identity')
self.conf.set_default('neutron', True, group='service_available')
self.conf.set_default('heat', True, group='service_available')
if not os.path.exists(str(os.environ.get('OS_TEST_LOCK_PATH'))):
os.mkdir(str(os.environ.get('OS_TEST_LOCK_PATH')))
lock_path = str(os.environ.get('OS_TEST_LOCK_PATH',
os.environ.get('TMPDIR', '/tmp')))
if not os.path.exists(lock_path):
os.mkdir(lock_path)
lockutils.set_defaults(
lock_path=str(os.environ.get('OS_TEST_LOCK_PATH')),
lock_path=lock_path,
)
self.conf.set_default('auth_version', 'v2', group='identity')
for config_option in ['username', 'password', 'project_name']: