[sqlite] fix crash on db-create with sqlite abd unexistent database due to missing paren in logical expression (closes #909604) stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 26 May 2010 12:31:37 +0200
branchstable
changeset 5585 e1cbf6b304ea
parent 5584 c1823448f81d
child 5586 aabe082fee02
[sqlite] fix crash on db-create with sqlite abd unexistent database due to missing paren in logical expression (closes #909604)
server/serverctl.py
--- a/server/serverctl.py	Wed May 26 12:31:34 2010 +0200
+++ b/server/serverctl.py	Wed May 26 12:31:37 2010 +0200
@@ -317,8 +317,9 @@
         create_db = self.config.create_db
         helper = get_db_helper(driver)
         if driver == 'sqlite':
-            if os.path.exists(dbname) and automatic or \
-                   ASK.confirm('Database %s already exists -- do you want to drop it ?' % dbname):
+            if os.path.exists(dbname) and (
+                automatic or
+                ASK.confirm('Database %s already exists. Drop it?' % dbname)):
                 os.unlink(dbname)
         elif create_db:
             print '\n'+underline_title('Creating the system database')