summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-02-26 11:11:14 +0000
committerGerrit Code Review <review@openstack.org>2016-02-26 11:11:14 +0000
commit5ee71e0acfa2475d318c993f7940d4139d8c3f86 (patch)
tree67d40080e1d7b9fa4767b45acabab3a856c94837
parent951be63b4e7d5321fb9c068854990baf736669c9 (diff)
parent5021ef82fd8f0323b82d6d010bff9dab8a0cbcec (diff)
downloadoslo-concurrency-5ee71e0acfa2475d318c993f7940d4139d8c3f86.tar.gz
Merge "Use tempfile.tempdir for lock_path if OSLO_LOCK_PATH is not set"
-rw-r--r--oslo_concurrency/lockutils.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/oslo_concurrency/lockutils.py b/oslo_concurrency/lockutils.py
index 2e61ff3..227af59 100644
--- a/oslo_concurrency/lockutils.py
+++ b/oslo_concurrency/lockutils.py
@@ -41,11 +41,14 @@ _opts = [
help='Enables or disables inter-process locks.',
deprecated_group='DEFAULT'),
cfg.StrOpt('lock_path',
- default=os.environ.get("OSLO_LOCK_PATH"),
+ default=os.environ.get("OSLO_LOCK_PATH", tempfile.gettempdir()),
help='Directory to use for lock files. For security, the '
'specified directory should only be writable by the user '
'running the processes that need locking. '
'Defaults to environment variable OSLO_LOCK_PATH. '
+ 'If OSLO_LOCK_PATH is not set in the environment, use the '
+ 'Python tempfile.gettempdir function to find a suitable '
+ 'location. '
'If external locks are used, a lock path must be set.',
deprecated_group='DEFAULT')
]