summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.de>2014-10-22 22:27:08 +0200
committerAndreas Jaeger <aj@suse.de>2014-10-24 20:44:24 +0200
commit973fb2cd6bf3bc7dee5635dc345417522865f0c9 (patch)
treef284955e33f66ab1973bacf8d26f62c209e300b8
parent151297f333bb168e58d0c101b51488c1810e14e3 (diff)
downloadoslo-concurrency-973fb2cd6bf3bc7dee5635dc345417522865f0c9.tar.gz
Improve lock_path help and documentation
Improve help string to state default value and that it's mandatory. Document set_defaults function. DocImpact: Document that the value needs to evaluate to a valid path. So, either environment variable is set or option is set. Change-Id: I481d2f8107476ba166a18bc56d3b4c1be5ff726f
-rw-r--r--oslo/concurrency/lockutils.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/oslo/concurrency/lockutils.py b/oslo/concurrency/lockutils.py
index bd08fb1..4726fd5 100644
--- a/oslo/concurrency/lockutils.py
+++ b/oslo/concurrency/lockutils.py
@@ -44,7 +44,9 @@ _opts = [
default=os.environ.get("OSLO_LOCK_PATH"),
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.',
+ 'running the processes that need locking. '
+ 'Defaults to environment variable OSLO_LOCK_PATH. '
+ 'If external locks are used, a lock path must be set.',
deprecated_group='DEFAULT')
]
@@ -54,6 +56,10 @@ CONF.register_opts(_opts, group='oslo_concurrency')
def set_defaults(lock_path):
+ """Set value for lock_path.
+
+ This can be used by tests to set lock_path to a temporary directory.
+ """
cfg.set_defaults(_opts, lock_path=lock_path)