summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2011-04-05 17:31:40 +0100
committerLars Wirzenius <liw@liw.fi>2011-04-05 17:31:40 +0100
commit2e3c20f8e1060d6f89847b75da2321e152676328 (patch)
tree64357b8ec6ce8a113bd2926684f780d431149f10
parent03b940d90667defe4a791efc307951386ac2d739 (diff)
downloadobnam-2e3c20f8e1060d6f89847b75da2321e152676328.tar.gz
Create client directory when locking.
This is necessary so it can be initialized properly.
-rw-r--r--obnamlib/repo.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/obnamlib/repo.py b/obnamlib/repo.py
index 15ffbc6e..c0423f01 100644
--- a/obnamlib/repo.py
+++ b/obnamlib/repo.py
@@ -385,7 +385,10 @@ class Repository(object):
if client_id is None:
raise LockFail('client %s does not exit' % client_name)
- client_dir = self.client_dir(client_id)
+ client_dir = self.client_dir(client_id)
+ if not self.fs.exists(client_dir):
+ self.fs.mkdir(client_dir)
+ self.hooks.call('repository-toplevel-init', self, client_dir)
lockname = os.path.join(client_dir, 'lock')
try:
self.fs.write_file(lockname, '')