[CalendarServer-changes] [6035] CalendarServer/branches/users/glyph/sql-store
source_changes at macosforge.org
source_changes at macosforge.org
Tue Aug 10 13:38:04 PDT 2010
Revision: 6035
http://trac.macosforge.org/projects/calendarserver/changeset/6035
Author: sagen at apple.com
Date: 2010-08-10 13:38:02 -0700 (Tue, 10 Aug 2010)
Log Message:
-----------
Postgres socket directory lives in /tmp
Modified Paths:
--------------
CalendarServer/branches/users/glyph/sql-store/conf/caldavd-test.plist
CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore/test/test_postgres.py
CalendarServer/branches/users/glyph/sql-store/txdav/datastore/subpostgres.py
CalendarServer/branches/users/glyph/sql-store/txdav/datastore/test/test_subpostgres.py
Modified: CalendarServer/branches/users/glyph/sql-store/conf/caldavd-test.plist
===================================================================
--- CalendarServer/branches/users/glyph/sql-store/conf/caldavd-test.plist 2010-08-10 20:22:28 UTC (rev 6034)
+++ CalendarServer/branches/users/glyph/sql-store/conf/caldavd-test.plist 2010-08-10 20:38:02 UTC (rev 6035)
@@ -84,7 +84,7 @@
<!-- Database root -->
<key>DatabaseRoot</key>
- <string>/tmp/calendar_database</string>
+ <string>Database</string>
<!-- Document root -->
<key>DocumentRoot</key>
Modified: CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore/test/test_postgres.py
===================================================================
--- CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore/test/test_postgres.py 2010-08-10 20:22:28 UTC (rev 6034)
+++ CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore/test/test_postgres.py 2010-08-10 20:38:02 UTC (rev 6035)
@@ -19,8 +19,6 @@
L{txcaldav.calendarstore.test.common}.
"""
-from hashlib import md5
-
from txcaldav.calendarstore.test.common import CommonTests as CalendarCommonTests
from txcarddav.addressbookstore.test.common import CommonTests as AddressBookCommonTests
from txdav.common.icommondatastore import NoSuchHomeChildError, HomeChildNameAlreadyExistsError
@@ -95,12 +93,8 @@
self.cleanDatabase(testCase)
ready.callback(self.store)
return self.store
- socketDirectory = CachingFilePath("/tmp/cs_test_%s" %
- (md5(dbRoot.path).hexdigest()))
self.sharedService = PostgresService(
- dbRoot, getReady, v1_schema, "caldav",
- socketDirectory=socketDirectory,
- resetSchema=True
+ dbRoot, getReady, v1_schema, "caldav", resetSchema=True
)
self.sharedService.startService()
def startStopping():
Modified: CalendarServer/branches/users/glyph/sql-store/txdav/datastore/subpostgres.py
===================================================================
--- CalendarServer/branches/users/glyph/sql-store/txdav/datastore/subpostgres.py 2010-08-10 20:22:28 UTC (rev 6034)
+++ CalendarServer/branches/users/glyph/sql-store/txdav/datastore/subpostgres.py 2010-08-10 20:38:02 UTC (rev 6035)
@@ -19,13 +19,16 @@
Run and manage PostgreSQL as a subprocess.
"""
import os
+from hashlib import md5
from twisted.python.procutils import which
from twisted.internet.utils import getProcessOutput
from twisted.internet.protocol import ProcessProtocol
from twisted.python.reflect import namedAny
from twisted.python import log
+from twext.python.filepath import CachingFilePath
+
pgdb = namedAny("pgdb")
from pg import DatabaseError
@@ -155,8 +158,7 @@
class PostgresService(MultiService):
def __init__(self, dataStoreDirectory, subServiceFactory,
- schema, databaseName='subpostgres', socketDirectory=None,
- resetSchema=False):
+ schema, databaseName='subpostgres', resetSchema=False):
"""
Initialize a L{PostgresService} pointed at a data store directory.
@@ -171,10 +173,8 @@
self.subServiceFactory = subServiceFactory
self.dataStoreDirectory = dataStoreDirectory
self.resetSchema = resetSchema
- if socketDirectory:
- self.socketDir = socketDirectory
- else:
- self.socketDir = self.dataStoreDirectory.child("socket")
+ self.socketDir = CachingFilePath("/tmp/ccs_postgres_%s/" %
+ (md5(dataStoreDirectory.path).hexdigest()))
self.databaseName = databaseName
self.schema = schema
self.monitor = None
Modified: CalendarServer/branches/users/glyph/sql-store/txdav/datastore/test/test_subpostgres.py
===================================================================
--- CalendarServer/branches/users/glyph/sql-store/txdav/datastore/test/test_subpostgres.py 2010-08-10 20:22:28 UTC (rev 6034)
+++ CalendarServer/branches/users/glyph/sql-store/txdav/datastore/test/test_subpostgres.py 2010-08-10 20:38:02 UTC (rev 6035)
@@ -18,8 +18,6 @@
Tests for txdav.datastore.subpostgres.
"""
-from hashlib import md5
-
from twisted.trial.unittest import TestCase
from twext.python.filepath import CachingFilePath
@@ -75,9 +73,6 @@
SimpleService,
"create table TEST_DUMMY_TABLE (stub varchar)",
"dummy_db",
- socketDirectory=CachingFilePath("/tmp/cs_test_%s" %
- (md5(dbPath).hexdigest(),)
- )
)
svc.startService()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100810/67ad57d7/attachment-0001.html>
More information about the calendarserver-changes
mailing list