summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Nemec <bnemec@redhat.com>2014-10-08 20:43:08 +0000
committerBen Nemec <bnemec@redhat.com>2014-10-08 20:44:30 +0000
commit10faffc95617a98661d01d114cc3dc2d2ae2dbe6 (patch)
tree50794318bad3f964e969322e134d5f2626446fdf
parent1b9c7cfa99d3eb825b5b11ee0f6fa795c589f134 (diff)
downloadoslo-concurrency-10faffc95617a98661d01d114cc3dc2d2ae2dbe6.tar.gz
Make lock_wrapper private
This is only intended to be called via the main() function, so it doesn't need to be public. Change-Id: Ia215abbe8f8b9e1d8f4f36027b95bc33788a1886
-rw-r--r--oslo/concurrency/lockutils.py4
-rw-r--r--tests/unit/test_lockutils.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/oslo/concurrency/lockutils.py b/oslo/concurrency/lockutils.py
index b8781ab..bd08fb1 100644
--- a/oslo/concurrency/lockutils.py
+++ b/oslo/concurrency/lockutils.py
@@ -333,7 +333,7 @@ def synchronized_with_prefix(lock_file_prefix):
return functools.partial(synchronized, lock_file_prefix=lock_file_prefix)
-def lock_wrapper(argv):
+def _lock_wrapper(argv):
"""Create a dir for locks and pass it to command from arguments
This is exposed as a console script entry point named
@@ -357,4 +357,4 @@ def lock_wrapper(argv):
def main():
- sys.exit(lock_wrapper(sys.argv))
+ sys.exit(_lock_wrapper(sys.argv))
diff --git a/tests/unit/test_lockutils.py b/tests/unit/test_lockutils.py
index 188eef1..0709f75 100644
--- a/tests/unit/test_lockutils.py
+++ b/tests/unit/test_lockutils.py
@@ -495,7 +495,7 @@ class LockutilsModuleTestCase(test_base.BaseTestCase):
'assert os.path.isdir(lock_path)',
])
argv = ['', sys.executable, '-c', script]
- retval = lockutils.lock_wrapper(argv)
+ retval = lockutils._lock_wrapper(argv)
self.assertEqual(retval, 0, "Bad OSLO_LOCK_PATH has been set")
def test_return_value_maintained(self):
@@ -504,7 +504,7 @@ class LockutilsModuleTestCase(test_base.BaseTestCase):
'sys.exit(1)',
])
argv = ['', sys.executable, '-c', script]
- retval = lockutils.lock_wrapper(argv)
+ retval = lockutils._lock_wrapper(argv)
self.assertEqual(retval, 1)