From 6927c39d628f78431e0787cb9ea48fe0b34d38f4 Mon Sep 17 00:00:00 2001 From: Sebastien Luttringer <sebastien.luttringer@smartjog.com> Date: Wed, 12 Oct 2011 14:02:36 +0200 Subject: [PATCH] fix database init currently db badly create if directory already exists before creation --- installsystems/database.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/installsystems/database.py b/installsystems/database.py index bd28df3..14286ce 100644 --- a/installsystems/database.py +++ b/installsystems/database.py @@ -45,6 +45,8 @@ class Database(object): if not istools.isfile(path): raise Exception("Database must be local") self.path = os.path.abspath(path) + if not os.path.exists(self.path): + raise Exception("Database not exists") self.conn = sqlite3.connect(self.path, isolation_level=None) self.conn.execute("PRAGMA foreign_keys = ON") -- GitLab