def test_lock_with_prefix(self): # TODO(efried): Embetter this test self.config(lock_path=tempfile.mkdtemp(), group='oslo_concurrency') foo = lockutils.lock_with_prefix('mypfix-') with foo('mylock', external=True): # We can't check much pass
from oslo_concurrency import lockutils _prefix = "fandak" lock = lockutils.lock_with_prefix(_prefix) lock_cleanup = lockutils.remove_external_lock_file_with_prefix(_prefix)