[Oval-commits] r249 - in trunk/oval-server: . oval/dba
Javier Fernandez-Sanguino Pen~a
jfs at alioth.debian.org
Tue Sep 4 21:19:33 UTC 2007
Author: jfs
Date: 2007-09-04 21:19:33 +0000 (Tue, 04 Sep 2007)
New Revision: 249
Added:
trunk/oval-server/OvalMonitor.BUGS
Modified:
trunk/oval-server/oval/dba/dba.py
trunk/oval-server/setup.py
Log:
Added missing contents from the patch sent by Pavel
Added: trunk/oval-server/OvalMonitor.BUGS
===================================================================
--- trunk/oval-server/OvalMonitor.BUGS (rev 0)
+++ trunk/oval-server/OvalMonitor.BUGS 2007-09-04 21:19:33 UTC (rev 249)
@@ -0,0 +1 @@
+Currently None
Modified: trunk/oval-server/oval/dba/dba.py
===================================================================
--- trunk/oval-server/oval/dba/dba.py 2007-09-04 21:12:51 UTC (rev 248)
+++ trunk/oval-server/oval/dba/dba.py 2007-09-04 21:19:33 UTC (rev 249)
@@ -10,6 +10,9 @@
class AgentDoesNotExistException(Exception):
pass
+class dbaNotAccesible (Exception):
+ pass
+
class dba:
"""
You need initialize static field dbPath before create instances of dba class"""
@@ -46,11 +49,11 @@
if dba.dbPath == None:
raise dbaNotInitialized
- self.__conn = db.connect(self.dbPath)
- self.__conn.isolation_level = None
- self.cursor = self.__conn.cursor()
- #Chech if tables exists
try:
+ self.__conn = db.connect(self.dbPath)
+ self.__conn.isolation_level = None
+ self.cursor = self.__conn.cursor()
+ #Chech if tables exists
self.cursor.execute ("""SELECT name FROM sqlite_master
WHERE type=\'table\'
ORDER BY name;""")
@@ -58,6 +61,9 @@
raise dbaNotInitialized ()
except dbaNotInitialized:
self.__initDB()
+ except db.OperationalError:
+ raise dbaNotAccesible
+
def getCursor(self):
if self.__conn:
@@ -122,4 +128,4 @@
if __name__ == "__main__":
dba.dbPath ='/home/blaze/tmp/oval/server/oval-server.db'
sql = dba()
- print sql.makeDefList(1)
\ No newline at end of file
+ print sql.makeDefList(1)
Modified: trunk/oval-server/setup.py
===================================================================
--- trunk/oval-server/setup.py 2007-09-04 21:12:51 UTC (rev 248)
+++ trunk/oval-server/setup.py 2007-09-04 21:19:33 UTC (rev 249)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python
#
# Written by Pavel VInogradov
# see LICENSE.txt for license information
More information about the Oval-commits
mailing list