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:
parent
1b9c7cfa99
commit
10faffc956
@ -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))
|
||||
|
@ -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)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user