Only create db directory if it does not yet exist.
authorJelmer Vernooij <jelmer@samba.org>
Sun, 18 May 2014 08:50:18 +0000 (10:50 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Sun, 18 May 2014 08:50:18 +0000 (10:50 +0200)
buildfarm/__init__.py

index ac6add95d793e77a2509bd243bb67a8c4809a9a1..7c4428e80bd4aa374ce425f68f8a9b3c0d42a615 100644 (file)
@@ -159,7 +159,8 @@ class BuildFarm(object):
         if self.store is not None:
             return self.store
         db_dir_path = os.path.join(self.path, "db")
-        os.mkdir(db_dir_path)
+        if not os.path.isdir(db_dir_path):
+            os.mkdir(db_dir_path)
         db_path = os.path.join(db_dir_path, "hostdb.sqlite")
         db = create_database("sqlite:%s?timeout=%f" % (db_path, self.timeout))
         self.store = Store(db)