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
This commit is contained in:
Ben Nemec 2014-10-08 20:43:08 +00:00
parent 1b9c7cfa99
commit 10faffc956
2 changed files with 4 additions and 4 deletions

View File

@ -333,7 +333,7 @@ def synchronized_with_prefix(lock_file_prefix):
return functools.partial(synchronized, lock_file_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 """Create a dir for locks and pass it to command from arguments
This is exposed as a console script entry point named This is exposed as a console script entry point named
@ -357,4 +357,4 @@ def lock_wrapper(argv):
def main(): def main():
sys.exit(lock_wrapper(sys.argv)) sys.exit(_lock_wrapper(sys.argv))

View File

@ -495,7 +495,7 @@ class LockutilsModuleTestCase(test_base.BaseTestCase):
'assert os.path.isdir(lock_path)', 'assert os.path.isdir(lock_path)',
]) ])
argv = ['', sys.executable, '-c', script] 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") self.assertEqual(retval, 0, "Bad OSLO_LOCK_PATH has been set")
def test_return_value_maintained(self): def test_return_value_maintained(self):
@ -504,7 +504,7 @@ class LockutilsModuleTestCase(test_base.BaseTestCase):
'sys.exit(1)', 'sys.exit(1)',
]) ])
argv = ['', sys.executable, '-c', script] argv = ['', sys.executable, '-c', script]
retval = lockutils.lock_wrapper(argv) retval = lockutils._lock_wrapper(argv)
self.assertEqual(retval, 1) self.assertEqual(retval, 1)