Create db directory if it did not yet exist.
[build-farm.git] / buildfarm / __init__.py
index 3708dc224fce1a4f0869e602f28ecf73020de017..ac6add95d793e77a2509bd243bb67a8c4809a9a1 100644 (file)
@@ -158,7 +158,9 @@ class BuildFarm(object):
     def _get_store(self):
         if self.store is not None:
             return self.store
-        db_path = os.path.join(self.path, "db", "hostdb.sqlite")
+        db_dir_path = os.path.join(self.path, "db")
+        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)
         setup_schema(self.store)