Permalink
Browse files

privacy.py: do not assume database directory exists

Fixes a bug in the MacOSX installer, where the installation fails
if the directory /var/neubot does not exist.

Reported by and with some help from Francesco Corazza.
  • Loading branch information...
bassosimone committed Nov 14, 2011
1 parent 0917a81 commit 881c497d926e97ae6b9e27f664db3a1164ba22d5
Showing with 3 additions and 4 deletions.
  1. +3 −4 neubot/privacy.py
View
@@ -25,7 +25,6 @@
import asyncore
import getopt
import os
-import sqlite3
import sys
import types
import xml.dom.minidom
@@ -37,6 +36,7 @@
from neubot.config import ConfigError
from neubot.log import LOG
from neubot.database import table_config
+from neubot.database import DATABASE
from neubot import rootdir
from neubot import system
from neubot import utils
@@ -168,10 +168,9 @@ def __main(args):
sys.exit(1)
else:
- connection = sqlite3.connect(database_path)
+ DATABASE.set_path(database_path)
+ connection = DATABASE.connection()
if settings:
- # Just in case...
- table_config.create(connection)
for name, value in settings.items():
if name not in ('privacy.informed', 'privacy.can_collect',
'privacy.can_share'):

0 comments on commit 881c497

Please sign in to comment.