Mercurial > kallithea
diff rhodecode/lib/pidlock.py @ 2568:29e999f26998 beta
pidlock always create dirs for lock file
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sat, 07 Jul 2012 13:43:16 +0200 |
parents | d6cb805c92fd |
children | ffd45b185016 |
line wrap: on
line diff
--- a/rhodecode/lib/pidlock.py Fri Jul 06 20:29:36 2012 +0200 +++ b/rhodecode/lib/pidlock.py Sat Jul 07 13:43:16 2012 +0200 @@ -8,6 +8,7 @@ from rhodecode.lib.compat import kill + class LockHeld(Exception): pass @@ -123,6 +124,10 @@ """ if self.debug: print 'creating a file %s and pid: %s' % (pidfile, lockname) + + dir_, file_ = os.path.split(pidfile) + if not os.path.isdir(dir_): + os.makedirs(dir_) pidfile = open(self.pidfile, "wb") pidfile.write(lockname) pidfile.close