From 10faffc95617a98661d01d114cc3dc2d2ae2dbe6 Mon Sep 17 00:00:00 2001 From: Ben Nemec Date: Wed, 8 Oct 2014 20:43:08 +0000 Subject: [PATCH] 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 --- oslo/concurrency/lockutils.py | 4 ++-- tests/unit/test_lockutils.py | 4 ++-- 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)