[CalendarServer-changes] [4771] CalendarServer/branches/release/CalendarServer-2.4-dev
source_changes at macosforge.org
source_changes at macosforge.org
Wed Nov 18 12:33:42 PST 2009
Revision: 4771
http://trac.macosforge.org/projects/calendarserver/changeset/4771
Author: glyph at apple.com
Date: 2009-11-18 12:33:42 -0800 (Wed, 18 Nov 2009)
Log Message:
-----------
Pulled up r4739 r4740 r4741 r4742 from trunk, along with some import conflict resolution.
Revision Links:
--------------
http://trac.macosforge.org/projects/calendarserver/changeset/4739
http://trac.macosforge.org/projects/calendarserver/changeset/4740
http://trac.macosforge.org/projects/calendarserver/changeset/4741
http://trac.macosforge.org/projects/calendarserver/changeset/4742
Modified Paths:
--------------
CalendarServer/branches/release/CalendarServer-2.4-dev/calendarserver/tools/principals.py
CalendarServer/branches/release/CalendarServer-2.4-dev/calendarserver/tools/util.py
CalendarServer/branches/release/CalendarServer-2.4-dev/twistedcaldav/directory/xmlaccountsparser.py
CalendarServer/branches/release/CalendarServer-2.4-dev/twistedcaldav/sql.py
Property Changed:
----------------
CalendarServer/branches/release/CalendarServer-2.4-dev/
Property changes on: CalendarServer/branches/release/CalendarServer-2.4-dev
___________________________________________________________________
Modified: svn:mergeinfo
- /CalendarServer/branches/users/sagen/resource-delegates-4038:4040-4067
/CalendarServer/branches/users/sagen/resource-delegates-4066:4068-4075
/CalendarServer/trunk:4439-4440,4448,4450,4464,4473-4475,4602,4711-4712,4716-4717,4748-4752,4758
+ /CalendarServer/branches/users/sagen/resource-delegates-4038:4040-4067
/CalendarServer/branches/users/sagen/resource-delegates-4066:4068-4075
/CalendarServer/trunk:4439-4440,4448,4450,4464,4473-4475,4602,4711-4712,4716-4717,4739-4742,4748-4752,4758
Modified: CalendarServer/branches/release/CalendarServer-2.4-dev/calendarserver/tools/principals.py
===================================================================
--- CalendarServer/branches/release/CalendarServer-2.4-dev/calendarserver/tools/principals.py 2009-11-18 20:05:55 UTC (rev 4770)
+++ CalendarServer/branches/release/CalendarServer-2.4-dev/calendarserver/tools/principals.py 2009-11-18 20:33:42 UTC (rev 4771)
@@ -38,6 +38,7 @@
from twistedcaldav.log import setLogLevelForNamespace
from twistedcaldav.notify import installNotificationClient
from twistedcaldav.static import CalendarHomeProvisioningFile
+from twistedcaldav.directory.directory import DirectoryError
from calendarserver.tools.util import booleanArgument, autoDisableMemcached
from calendarserver.tools.util import loadConfig, getDirectory
@@ -190,7 +191,10 @@
os.umask(config.umask)
- config.directory = getDirectory()
+ try:
+ config.directory = getDirectory()
+ except DirectoryError, e:
+ abort(e)
autoDisableMemcached(config)
except ConfigurationError, e:
abort(e)
Modified: CalendarServer/branches/release/CalendarServer-2.4-dev/calendarserver/tools/util.py
===================================================================
--- CalendarServer/branches/release/CalendarServer-2.4-dev/calendarserver/tools/util.py 2009-11-18 20:05:55 UTC (rev 4770)
+++ CalendarServer/branches/release/CalendarServer-2.4-dev/calendarserver/tools/util.py 2009-11-18 20:33:42 UTC (rev 4771)
@@ -122,10 +122,6 @@
else:
raise ValueError("Not a boolean: %s" % (arg,))
-
-
-
-
def autoDisableMemcached(config):
"""
If memcached is not running, set config.Memcached.ClientEnabled to False
Modified: CalendarServer/branches/release/CalendarServer-2.4-dev/twistedcaldav/directory/xmlaccountsparser.py
===================================================================
--- CalendarServer/branches/release/CalendarServer-2.4-dev/twistedcaldav/directory/xmlaccountsparser.py 2009-11-18 20:05:55 UTC (rev 4770)
+++ CalendarServer/branches/release/CalendarServer-2.4-dev/twistedcaldav/directory/xmlaccountsparser.py 2009-11-18 20:33:42 UTC (rev 4771)
@@ -30,6 +30,8 @@
from twistedcaldav.config import config
from twistedcaldav.directory.directory import DirectoryService
from twistedcaldav.log import Logger
+from twistedcaldav.sql import DatabaseError
+from twistedcaldav.directory.directory import DirectoryError
from twistedcaldav.directory.resourceinfo import ResourceInfoDatabase
from twistedcaldav.directory.calendaruserproxy import CalendarUserProxyDatabase
@@ -97,7 +99,10 @@
log.error("Ignoring file %r because it is not a repository builder file" % (self.xmlFile,))
return
self._parseXML(accounts_node)
- self._updateExternalDatabases()
+ try:
+ self._updateExternalDatabases()
+ except DatabaseError, e:
+ raise DirectoryError(e)
def _updateExternalDatabases(self):
resourceInfoDatabase = ResourceInfoDatabase(config.DataRoot)
Modified: CalendarServer/branches/release/CalendarServer-2.4-dev/twistedcaldav/sql.py
===================================================================
--- CalendarServer/branches/release/CalendarServer-2.4-dev/twistedcaldav/sql.py 2009-11-18 20:05:55 UTC (rev 4770)
+++ CalendarServer/branches/release/CalendarServer-2.4-dev/twistedcaldav/sql.py 2009-11-18 20:33:42 UTC (rev 4771)
@@ -18,9 +18,10 @@
Generic SQL database access object.
"""
-__all__ = [
+__all__ = [
+ "db_prefix",
+ "DatabaseError",
"AbstractSQLDatabase",
- "db_prefix"
]
import os
@@ -36,7 +37,11 @@
db_prefix = ".db."
-class AbstractSQLDatabase(object):
+
+DatabaseError = sqlite.DatabaseError
+
+
+class AbstractSQLDatabase (object):
"""
A generic SQL database.
"""
@@ -83,9 +88,8 @@
self._db_connection = sqlite.connect(db_filename, isolation_level=None)
else:
self._db_connection = sqlite.connect(db_filename)
- except:
- log.err("Unable to open database: %s" % (self,))
- raise
+ except DatabaseError:
+ raise DatabaseError("Unable to open database %s" % (self.dbpath,))
#
# Set up the schema
@@ -304,7 +308,7 @@
try:
q.execute(sql, query_params)
return q.fetchall()
- except:
+ except DatabaseError:
log.err("Exception while executing SQL on DB %s: %r %r" % (self, sql, query_params))
raise
finally:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20091118/33d97ed3/attachment-0001.html>
More information about the calendarserver-changes
mailing list