lockfiles : creates directory for locks if not already present

This commit is contained in:
alalazo 2016-05-13 14:47:44 +02:00 committed by Todd Gamblin
parent a3fc492d45
commit f47dcdc47a

View File

@ -155,6 +155,8 @@ def __init__(
if lock: if lock:
self._lock_file = join_path(spack.stage_path, self.name + '.lock') self._lock_file = join_path(spack.stage_path, self.name + '.lock')
if not os.path.exists(self._lock_file): if not os.path.exists(self._lock_file):
directory, _ = os.path.split(self._lock_file)
mkdirp(directory)
touch(self._lock_file) touch(self._lock_file)
self._lock = llnl.util.lock.Lock(self._lock_file) self._lock = llnl.util.lock.Lock(self._lock_file)