[CalendarServer-changes] [14460] CalendarServer/branches/users/cdaboo/pod2pod-migration

source_changes at macosforge.org source_changes at macosforge.org
Fri Feb 20 07:20:56 PST 2015


Revision: 14460
          http://trac.calendarserver.org//changeset/14460
Author:   cdaboo at apple.com
Date:     2015-02-20 07:20:56 -0800 (Fri, 20 Feb 2015)
Log Message:
-----------
Merge from trunk.

Modified Paths:
--------------
    CalendarServer/branches/users/cdaboo/pod2pod-migration/bin/_py.sh
    CalendarServer/branches/users/cdaboo/pod2pod-migration/bin/test
    CalendarServer/branches/users/cdaboo/pod2pod-migration/doc/Admin/MultiServerDeployment.rst
    CalendarServer/branches/users/cdaboo/pod2pod-migration/requirements-dev.txt
    CalendarServer/branches/users/cdaboo/pod2pod-migration/requirements-stable.txt
    CalendarServer/branches/users/cdaboo/pod2pod-migration/twistedcaldav/database.py
    CalendarServer/branches/users/cdaboo/pod2pod-migration/twistedcaldav/directory/test/test_proxyprincipaldb.py
    CalendarServer/branches/users/cdaboo/pod2pod-migration/txdav/base/datastore/subpostgres.py
    CalendarServer/branches/users/cdaboo/pod2pod-migration/txdav/base/datastore/test/test_subpostgres.py
    CalendarServer/branches/users/cdaboo/pod2pod-migration/txdav/caldav/datastore/scheduling/imip/test/test_outbound.py
    CalendarServer/branches/users/cdaboo/pod2pod-migration/txdav/carddav/datastore/sql.py
    CalendarServer/branches/users/cdaboo/pod2pod-migration/txdav/carddav/datastore/test/test_sql.py
    CalendarServer/branches/users/cdaboo/pod2pod-migration/txdav/common/datastore/test/test_sql.py
    CalendarServer/branches/users/cdaboo/pod2pod-migration/txdav/common/datastore/upgrade/sql/test/test_upgrade_with_data.py

Property Changed:
----------------
    CalendarServer/branches/users/cdaboo/pod2pod-migration/


Property changes on: CalendarServer/branches/users/cdaboo/pod2pod-migration
___________________________________________________________________
Modified: svn:mergeinfo
   - /CalDAVTester/trunk:11193-11198
/CalendarServer/branches/config-separation:4379-4443
/CalendarServer/branches/egg-info-351:4589-4625
/CalendarServer/branches/generic-sqlstore:6167-6191
/CalendarServer/branches/new-store:5594-5934
/CalendarServer/branches/new-store-no-caldavfile:5911-5935
/CalendarServer/branches/new-store-no-caldavfile-2:5936-5981
/CalendarServer/branches/release/CalendarServer-4.3-dev:10180-10190,10192
/CalendarServer/branches/release/CalendarServer-5.1-dev:11846
/CalendarServer/branches/release/CalendarServer-5.2-dev:11972,12357-12358,12794,12814
/CalendarServer/branches/users/cdaboo/batchupload-6699:6700-7198
/CalendarServer/branches/users/cdaboo/cached-subscription-calendars-5692:5693-5702
/CalendarServer/branches/users/cdaboo/component-set-fixes:8130-8346
/CalendarServer/branches/users/cdaboo/cross-pod-sharing:12038-12191
/CalendarServer/branches/users/cdaboo/directory-cache-on-demand-3627:3628-3644
/CalendarServer/branches/users/cdaboo/fix-no-ischedule:11607-11871
/CalendarServer/branches/users/cdaboo/implicituidrace:8137-8141
/CalendarServer/branches/users/cdaboo/ischedule-dkim:9747-9979
/CalendarServer/branches/users/cdaboo/json:11622-11912
/CalendarServer/branches/users/cdaboo/managed-attachments:9985-10145
/CalendarServer/branches/users/cdaboo/more-sharing-5591:5592-5601
/CalendarServer/branches/users/cdaboo/partition-4464:4465-4957
/CalendarServer/branches/users/cdaboo/performance-tweaks:11824-11836
/CalendarServer/branches/users/cdaboo/pods:7297-7377
/CalendarServer/branches/users/cdaboo/pycalendar:7085-7206
/CalendarServer/branches/users/cdaboo/pycard:7227-7237
/CalendarServer/branches/users/cdaboo/queued-attendee-refreshes:7740-8287
/CalendarServer/branches/users/cdaboo/relative-config-paths-5070:5071-5105
/CalendarServer/branches/users/cdaboo/reverse-proxy-pods:11875-11900
/CalendarServer/branches/users/cdaboo/scheduling-queue-refresh:11783-12557
/CalendarServer/branches/users/cdaboo/shared-calendars-5187:5188-5440
/CalendarServer/branches/users/cdaboo/sharing-in-the-store:11935-12016
/CalendarServer/branches/users/cdaboo/store-scheduling:10876-11129
/CalendarServer/branches/users/cdaboo/timezones:7443-7699
/CalendarServer/branches/users/cdaboo/txn-debugging:8730-8743
/CalendarServer/branches/users/gaya/cleanrevisions:12152-12334
/CalendarServer/branches/users/gaya/groupsharee2:13669-13773
/CalendarServer/branches/users/gaya/sharedgroupfixes:12120-12142
/CalendarServer/branches/users/gaya/sharedgroups-3:11088-11204
/CalendarServer/branches/users/glyph/always-abort-txn-on-error:9958-9969
/CalendarServer/branches/users/glyph/case-insensitive-uid:8772-8805
/CalendarServer/branches/users/glyph/conn-limit:6574-6577
/CalendarServer/branches/users/glyph/contacts-server-merge:4971-5080
/CalendarServer/branches/users/glyph/dalify:6932-7023
/CalendarServer/branches/users/glyph/db-reconnect:6824-6876
/CalendarServer/branches/users/glyph/deploybuild:7563-7572
/CalendarServer/branches/users/glyph/digest-auth-redux:10624-10635
/CalendarServer/branches/users/glyph/disable-quota:7718-7727
/CalendarServer/branches/users/glyph/dont-start-postgres:6592-6614
/CalendarServer/branches/users/glyph/enforce-max-requests:11640-11643
/CalendarServer/branches/users/glyph/hang-fix:11465-11491
/CalendarServer/branches/users/glyph/imip-and-admin-html:7866-7984
/CalendarServer/branches/users/glyph/ipv6-client:9054-9105
/CalendarServer/branches/users/glyph/launchd-wrapper-bis:11413-11436
/CalendarServer/branches/users/glyph/linux-tests:6893-6900
/CalendarServer/branches/users/glyph/log-cleanups:11691-11731
/CalendarServer/branches/users/glyph/migrate-merge:8690-8713
/CalendarServer/branches/users/glyph/misc-portability-fixes:7365-7374
/CalendarServer/branches/users/glyph/more-deferreds-6:6322-6368
/CalendarServer/branches/users/glyph/more-deferreds-7:6369-6445
/CalendarServer/branches/users/glyph/multiget-delete:8321-8330
/CalendarServer/branches/users/glyph/new-export:7444-7485
/CalendarServer/branches/users/glyph/one-home-list-api:10048-10073
/CalendarServer/branches/users/glyph/oracle:7106-7155
/CalendarServer/branches/users/glyph/oracle-nulls:7340-7351
/CalendarServer/branches/users/glyph/other-html:8062-8091
/CalendarServer/branches/users/glyph/parallel-sim:8240-8251
/CalendarServer/branches/users/glyph/parallel-upgrade:8376-8400
/CalendarServer/branches/users/glyph/parallel-upgrade_to_1:8571-8583
/CalendarServer/branches/users/glyph/q:9560-9688
/CalendarServer/branches/users/glyph/queue-locking-and-timing:10204-10289
/CalendarServer/branches/users/glyph/quota:7604-7637
/CalendarServer/branches/users/glyph/sendfdport:5388-5424
/CalendarServer/branches/users/glyph/shared-pool-fixes:8436-8443
/CalendarServer/branches/users/glyph/shared-pool-take2:8155-8174
/CalendarServer/branches/users/glyph/sharedpool:6490-6550
/CalendarServer/branches/users/glyph/sharing-api:9192-9205
/CalendarServer/branches/users/glyph/skip-lonely-vtimezones:8524-8535
/CalendarServer/branches/users/glyph/sql-store:5929-6073
/CalendarServer/branches/users/glyph/start-service-start-loop:11060-11065
/CalendarServer/branches/users/glyph/subtransactions:7248-7258
/CalendarServer/branches/users/glyph/table-alias:8651-8664
/CalendarServer/branches/users/glyph/uidexport:7673-7676
/CalendarServer/branches/users/glyph/unshare-when-access-revoked:10562-10595
/CalendarServer/branches/users/glyph/use-system-twisted:5084-5149
/CalendarServer/branches/users/glyph/uuid-normalize:9268-9296
/CalendarServer/branches/users/glyph/warning-cleanups:11347-11357
/CalendarServer/branches/users/glyph/whenNotProposed:11881-11897
/CalendarServer/branches/users/glyph/xattrs-from-files:7757-7769
/CalendarServer/branches/users/sagen/applepush:8126-8184
/CalendarServer/branches/users/sagen/inboxitems:7380-7381
/CalendarServer/branches/users/sagen/locations-resources:5032-5051
/CalendarServer/branches/users/sagen/locations-resources-2:5052-5061
/CalendarServer/branches/users/sagen/move2who:12819-12860
/CalendarServer/branches/users/sagen/move2who-2:12861-12898
/CalendarServer/branches/users/sagen/move2who-3:12899-12913
/CalendarServer/branches/users/sagen/move2who-4:12914-13157
/CalendarServer/branches/users/sagen/move2who-5:13158-13163
/CalendarServer/branches/users/sagen/newcua:13309-13327
/CalendarServer/branches/users/sagen/newcua-1:13328-13330
/CalendarServer/branches/users/sagen/purge_old_events:6735-6746
/CalendarServer/branches/users/sagen/recordtypes:13648-13656
/CalendarServer/branches/users/sagen/recordtypes-2:13657
/CalendarServer/branches/users/sagen/resource-delegates-4038:4040-4067
/CalendarServer/branches/users/sagen/resource-delegates-4066:4068-4075
/CalendarServer/branches/users/sagen/resources-2:5084-5093
/CalendarServer/branches/users/sagen/testing:10827-10851,10853-10855
/CalendarServer/branches/users/wsanchez/transations:5515-5593
/CalendarServer/trunk:14338-14412
   + /CalDAVTester/trunk:11193-11198
/CalendarServer/branches/config-separation:4379-4443
/CalendarServer/branches/egg-info-351:4589-4625
/CalendarServer/branches/generic-sqlstore:6167-6191
/CalendarServer/branches/new-store:5594-5934
/CalendarServer/branches/new-store-no-caldavfile:5911-5935
/CalendarServer/branches/new-store-no-caldavfile-2:5936-5981
/CalendarServer/branches/release/CalendarServer-4.3-dev:10180-10190,10192
/CalendarServer/branches/release/CalendarServer-5.1-dev:11846
/CalendarServer/branches/release/CalendarServer-5.2-dev:11972,12357-12358,12794,12814
/CalendarServer/branches/users/cdaboo/batchupload-6699:6700-7198
/CalendarServer/branches/users/cdaboo/cached-subscription-calendars-5692:5693-5702
/CalendarServer/branches/users/cdaboo/component-set-fixes:8130-8346
/CalendarServer/branches/users/cdaboo/cross-pod-sharing:12038-12191
/CalendarServer/branches/users/cdaboo/directory-cache-on-demand-3627:3628-3644
/CalendarServer/branches/users/cdaboo/fix-no-ischedule:11607-11871
/CalendarServer/branches/users/cdaboo/implicituidrace:8137-8141
/CalendarServer/branches/users/cdaboo/ischedule-dkim:9747-9979
/CalendarServer/branches/users/cdaboo/json:11622-11912
/CalendarServer/branches/users/cdaboo/managed-attachments:9985-10145
/CalendarServer/branches/users/cdaboo/more-sharing-5591:5592-5601
/CalendarServer/branches/users/cdaboo/partition-4464:4465-4957
/CalendarServer/branches/users/cdaboo/performance-tweaks:11824-11836
/CalendarServer/branches/users/cdaboo/pods:7297-7377
/CalendarServer/branches/users/cdaboo/pycalendar:7085-7206
/CalendarServer/branches/users/cdaboo/pycard:7227-7237
/CalendarServer/branches/users/cdaboo/queued-attendee-refreshes:7740-8287
/CalendarServer/branches/users/cdaboo/relative-config-paths-5070:5071-5105
/CalendarServer/branches/users/cdaboo/reverse-proxy-pods:11875-11900
/CalendarServer/branches/users/cdaboo/scheduling-queue-refresh:11783-12557
/CalendarServer/branches/users/cdaboo/shared-calendars-5187:5188-5440
/CalendarServer/branches/users/cdaboo/sharing-in-the-store:11935-12016
/CalendarServer/branches/users/cdaboo/store-scheduling:10876-11129
/CalendarServer/branches/users/cdaboo/timezones:7443-7699
/CalendarServer/branches/users/cdaboo/txn-debugging:8730-8743
/CalendarServer/branches/users/gaya/cleanrevisions:12152-12334
/CalendarServer/branches/users/gaya/groupsharee2:13669-13773
/CalendarServer/branches/users/gaya/sharedgroupfixes:12120-12142
/CalendarServer/branches/users/gaya/sharedgroups-3:11088-11204
/CalendarServer/branches/users/glyph/always-abort-txn-on-error:9958-9969
/CalendarServer/branches/users/glyph/case-insensitive-uid:8772-8805
/CalendarServer/branches/users/glyph/conn-limit:6574-6577
/CalendarServer/branches/users/glyph/contacts-server-merge:4971-5080
/CalendarServer/branches/users/glyph/dalify:6932-7023
/CalendarServer/branches/users/glyph/db-reconnect:6824-6876
/CalendarServer/branches/users/glyph/deploybuild:7563-7572
/CalendarServer/branches/users/glyph/digest-auth-redux:10624-10635
/CalendarServer/branches/users/glyph/disable-quota:7718-7727
/CalendarServer/branches/users/glyph/dont-start-postgres:6592-6614
/CalendarServer/branches/users/glyph/enforce-max-requests:11640-11643
/CalendarServer/branches/users/glyph/hang-fix:11465-11491
/CalendarServer/branches/users/glyph/imip-and-admin-html:7866-7984
/CalendarServer/branches/users/glyph/ipv6-client:9054-9105
/CalendarServer/branches/users/glyph/launchd-wrapper-bis:11413-11436
/CalendarServer/branches/users/glyph/linux-tests:6893-6900
/CalendarServer/branches/users/glyph/log-cleanups:11691-11731
/CalendarServer/branches/users/glyph/migrate-merge:8690-8713
/CalendarServer/branches/users/glyph/misc-portability-fixes:7365-7374
/CalendarServer/branches/users/glyph/more-deferreds-6:6322-6368
/CalendarServer/branches/users/glyph/more-deferreds-7:6369-6445
/CalendarServer/branches/users/glyph/multiget-delete:8321-8330
/CalendarServer/branches/users/glyph/new-export:7444-7485
/CalendarServer/branches/users/glyph/one-home-list-api:10048-10073
/CalendarServer/branches/users/glyph/oracle:7106-7155
/CalendarServer/branches/users/glyph/oracle-nulls:7340-7351
/CalendarServer/branches/users/glyph/other-html:8062-8091
/CalendarServer/branches/users/glyph/parallel-sim:8240-8251
/CalendarServer/branches/users/glyph/parallel-upgrade:8376-8400
/CalendarServer/branches/users/glyph/parallel-upgrade_to_1:8571-8583
/CalendarServer/branches/users/glyph/q:9560-9688
/CalendarServer/branches/users/glyph/queue-locking-and-timing:10204-10289
/CalendarServer/branches/users/glyph/quota:7604-7637
/CalendarServer/branches/users/glyph/sendfdport:5388-5424
/CalendarServer/branches/users/glyph/shared-pool-fixes:8436-8443
/CalendarServer/branches/users/glyph/shared-pool-take2:8155-8174
/CalendarServer/branches/users/glyph/sharedpool:6490-6550
/CalendarServer/branches/users/glyph/sharing-api:9192-9205
/CalendarServer/branches/users/glyph/skip-lonely-vtimezones:8524-8535
/CalendarServer/branches/users/glyph/sql-store:5929-6073
/CalendarServer/branches/users/glyph/start-service-start-loop:11060-11065
/CalendarServer/branches/users/glyph/subtransactions:7248-7258
/CalendarServer/branches/users/glyph/table-alias:8651-8664
/CalendarServer/branches/users/glyph/uidexport:7673-7676
/CalendarServer/branches/users/glyph/unshare-when-access-revoked:10562-10595
/CalendarServer/branches/users/glyph/use-system-twisted:5084-5149
/CalendarServer/branches/users/glyph/uuid-normalize:9268-9296
/CalendarServer/branches/users/glyph/warning-cleanups:11347-11357
/CalendarServer/branches/users/glyph/whenNotProposed:11881-11897
/CalendarServer/branches/users/glyph/xattrs-from-files:7757-7769
/CalendarServer/branches/users/sagen/applepush:8126-8184
/CalendarServer/branches/users/sagen/inboxitems:7380-7381
/CalendarServer/branches/users/sagen/locations-resources:5032-5051
/CalendarServer/branches/users/sagen/locations-resources-2:5052-5061
/CalendarServer/branches/users/sagen/move2who:12819-12860
/CalendarServer/branches/users/sagen/move2who-2:12861-12898
/CalendarServer/branches/users/sagen/move2who-3:12899-12913
/CalendarServer/branches/users/sagen/move2who-4:12914-13157
/CalendarServer/branches/users/sagen/move2who-5:13158-13163
/CalendarServer/branches/users/sagen/newcua:13309-13327
/CalendarServer/branches/users/sagen/newcua-1:13328-13330
/CalendarServer/branches/users/sagen/purge_old_events:6735-6746
/CalendarServer/branches/users/sagen/recordtypes:13648-13656
/CalendarServer/branches/users/sagen/recordtypes-2:13657
/CalendarServer/branches/users/sagen/resource-delegates-4038:4040-4067
/CalendarServer/branches/users/sagen/resource-delegates-4066:4068-4075
/CalendarServer/branches/users/sagen/resources-2:5084-5093
/CalendarServer/branches/users/sagen/testing:10827-10851,10853-10855
/CalendarServer/branches/users/wsanchez/psycopg2cffi:14427-14439
/CalendarServer/branches/users/wsanchez/transations:5515-5593
/CalendarServer/trunk:14338-14459

Modified: CalendarServer/branches/users/cdaboo/pod2pod-migration/bin/_py.sh
===================================================================
--- CalendarServer/branches/users/cdaboo/pod2pod-migration/bin/_py.sh	2015-02-20 15:14:42 UTC (rev 14459)
+++ CalendarServer/branches/users/cdaboo/pod2pod-migration/bin/_py.sh	2015-02-20 15:20:56 UTC (rev 14460)
@@ -61,27 +61,17 @@
 # Detect which version of Python to use, then print out which one was detected.
 #
 # This will prefer the python interpreter in the PYTHON environment variable.
-# If that's not found, it will check for "python2.7", "python2.6" and "python",
-# looking for each in your PATH and, failing that, in a number of well-known
-# locations.
+# If that's not found, it will check for "python2.7" and "python", looking for
+# each in your PATH.
 #
 detect_python_version () {
   local v;
   local p;
-  for v in "2.7" "2.6" ""
+  for v in "2.7" ""
   do
-    for p in                                                            \
-      "${PYTHON:=}"                                                     \
-      "python${v}"                                                      \
-      "/usr/local/bin/python${v}"                                       \
-      "/usr/local/python/bin/python${v}"                                \
-      "/usr/local/python${v}/bin/python${v}"                            \
-      "/opt/bin/python${v}"                                             \
-      "/opt/python/bin/python${v}"                                      \
-      "/opt/python${v}/bin/python${v}"                                  \
-      "/Library/Frameworks/Python.framework/Versions/${v}/bin/python"   \
-      "/opt/local/bin/python${v}"                                       \
-      "/sw/bin/python${v}"                                              \
+    for p in         \
+      "${PYTHON:=}"  \
+      "python${v}"   \
       ;
     do
       if p="$(find_cmd "${p}")"; then

Modified: CalendarServer/branches/users/cdaboo/pod2pod-migration/bin/test
===================================================================
--- CalendarServer/branches/users/cdaboo/pod2pod-migration/bin/test	2015-02-20 15:14:42 UTC (rev 14459)
+++ CalendarServer/branches/users/cdaboo/pod2pod-migration/bin/test	2015-02-20 15:20:56 UTC (rev 14460)
@@ -93,8 +93,12 @@
 
 develop > /dev/null "${dev_home}/setup.log";
 
+echo "Using ${python} as Python:";
+"${python}" -V;
+echo "";
 
 
+
 #
 # Clean up
 #

Modified: CalendarServer/branches/users/cdaboo/pod2pod-migration/doc/Admin/MultiServerDeployment.rst
===================================================================
--- CalendarServer/branches/users/cdaboo/pod2pod-migration/doc/Admin/MultiServerDeployment.rst	2015-02-20 15:14:42 UTC (rev 14459)
+++ CalendarServer/branches/users/cdaboo/pod2pod-migration/doc/Admin/MultiServerDeployment.rst	2015-02-20 15:20:56 UTC (rev 14460)
@@ -10,7 +10,7 @@
 
 * `Memcached`_: All Calendar Server hosts need to share access to memcached
 
-* `Proxy Database`_: Normally the Proxy (delegation) database is kept in a local sqlite database, which is not sharable. Create an additional database on the DB server to hold the Proxy DB, then configure all the servers to use it.
+* `Proxy Database`_: In previous versions, the proxy (delegate) database was a separate SQLite or Postgres container, however as of 6.0 this data is stored in the primary database along with other user data, so no special steps are required here.
 
 * `Directory Services`_: All servers should have access to the same directory services data that defines users, groups, resources, and locations. Calendar Server provides a highly flexible LDAP client to leverage existing directory servers, or you can use local XML files.
 
@@ -123,6 +123,8 @@
 Proxy Database
 ----------------
 
+As of version 6.0, the proxy data is stored in the main database, and no special steps are required to configure a multi-server deployment to share proxy data. The rest of the information in this section applies only to server versions before 6.0.
+
 The Proxy DB (for delegation) is typically stored on disk in an sqlite DB, which does not allow for concurrent access across multiple hosts. To address this, create an additional DB in the postgres server, then edit caldavd.plist to add something like the following, and disable any other ProxyDB configuration.
 
 ::

Modified: CalendarServer/branches/users/cdaboo/pod2pod-migration/requirements-dev.txt
===================================================================
--- CalendarServer/branches/users/cdaboo/pod2pod-migration/requirements-dev.txt	2015-02-20 15:14:42 UTC (rev 14459)
+++ CalendarServer/branches/users/cdaboo/pod2pod-migration/requirements-dev.txt	2015-02-20 15:20:56 UTC (rev 14460)
@@ -8,4 +8,4 @@
 q
 tl.eggdeps
 --editable svn+http://svn.calendarserver.org/repository/calendarserver/CalDAVClientLibrary/trunk@13420#egg=CalDAVClientLibrary
---editable svn+http://svn.calendarserver.org/repository/calendarserver/CalDAVTester/trunk@14409#egg=CalDAVTester
+--editable svn+http://svn.calendarserver.org/repository/calendarserver/CalDAVTester/trunk@14436#egg=CalDAVTester

Modified: CalendarServer/branches/users/cdaboo/pod2pod-migration/requirements-stable.txt
===================================================================
--- CalendarServer/branches/users/cdaboo/pod2pod-migration/requirements-stable.txt	2015-02-20 15:14:42 UTC (rev 14459)
+++ CalendarServer/branches/users/cdaboo/pod2pod-migration/requirements-stable.txt	2015-02-20 15:20:56 UTC (rev 14460)
@@ -36,7 +36,7 @@
             #pyOpenSSL
         pycrypto==2.6.1
 
-    --editable svn+http://svn.calendarserver.org/repository/calendarserver/twext/branches/users/cdaboo/pod2pod-migration@14457#egg=twextpy
+    --editable svn+http://svn.calendarserver.org/repository/calendarserver/twext/branches/users/cdaboo/pod2pod-migration@14459#egg=twextpy
         cffi==0.8.6
             pycparser==2.10
         #twisted

Modified: CalendarServer/branches/users/cdaboo/pod2pod-migration/twistedcaldav/database.py
===================================================================
--- CalendarServer/branches/users/cdaboo/pod2pod-migration/twistedcaldav/database.py	2015-02-20 15:14:42 UTC (rev 14459)
+++ CalendarServer/branches/users/cdaboo/pod2pod-migration/twistedcaldav/database.py	2015-02-20 15:20:56 UTC (rev 14460)
@@ -17,10 +17,9 @@
 import thread
 
 try:
-    import pgdb
+    import pgdb as postgres
 except:
-    pgdb = None
-# pgdb = None
+    postgres = None
 
 from twisted.enterprise.adbapi import ConnectionPool
 from twisted.internet.defer import inlineCallbacks, returnValue
@@ -571,7 +570,7 @@
         # internal statements so we do not need to remap those
         return sql
 
-if pgdb:
+if postgres:
 
     class ADBAPIPostgreSQLMixin(object):
 
@@ -608,7 +607,7 @@
 
             try:
                 yield self._db_execute(statement)
-            except pgdb.DatabaseError:
+            except postgres.DatabaseError:
 
                 if not ifnotexists:
                     raise
@@ -638,7 +637,7 @@
 
             try:
                 yield self._db_execute(statement)
-            except pgdb.DatabaseError:
+            except postgres.DatabaseError:
 
                 if not ifnotexists:
                     raise
@@ -677,7 +676,7 @@
                     values ('TYPE', :1)
                     """, (self._db_type(),)
                 )
-            except pgdb.DatabaseError:
+            except postgres.DatabaseError:
                 pass
 
 

Modified: CalendarServer/branches/users/cdaboo/pod2pod-migration/twistedcaldav/directory/test/test_proxyprincipaldb.py
===================================================================
--- CalendarServer/branches/users/cdaboo/pod2pod-migration/twistedcaldav/directory/test/test_proxyprincipaldb.py	2015-02-20 15:14:42 UTC (rev 14459)
+++ CalendarServer/branches/users/cdaboo/pod2pod-migration/twistedcaldav/directory/test/test_proxyprincipaldb.py	2015-02-20 15:20:56 UTC (rev 14460)
@@ -598,11 +598,11 @@
 
 
 try:
-    import pgdb
+    import pgdb as postgres
 except ImportError:
     ProxyPrincipalDBPostgreSQL.skip = True
 else:
     try:
-        db = pgdb.connect(host="localhost", database="proxies")
+        db = postgres.connect(host="localhost", database="proxies")
     except:
         ProxyPrincipalDBPostgreSQL.skip = True

Modified: CalendarServer/branches/users/cdaboo/pod2pod-migration/txdav/base/datastore/subpostgres.py
===================================================================
--- CalendarServer/branches/users/cdaboo/pod2pod-migration/txdav/base/datastore/subpostgres.py	2015-02-20 15:14:42 UTC (rev 14459)
+++ CalendarServer/branches/users/cdaboo/pod2pod-migration/txdav/base/datastore/subpostgres.py	2015-02-20 15:20:56 UTC (rev 14460)
@@ -26,7 +26,7 @@
 from hashlib import md5
 from pipes import quote as shell_quote
 
-import pgdb
+import pgdb as postgres
 
 from twisted.python.procutils import which
 from twisted.internet.protocol import ProcessProtocol
@@ -254,6 +254,7 @@
             self.port = None
             self.listenAddresses = []
 
+        self.testMode = testMode
         self.sharedBuffers = sharedBuffers if not testMode else 16
         self.maxConnections = maxConnections if not testMode else 8
         self.options = options
@@ -292,20 +293,20 @@
 
     def activateDelayedShutdown(self):
         """
-        Call this when starting database initialization code to protect against
-        shutdown.
+        Call this when starting database initialization code to
+        protect against shutdown.
 
-        Sets the delayedShutdown flag to True so that if reactor shutdown
-        commences, the shutdown will be delayed until deactivateDelayedShutdown
-        is called.
+        Sets the delayedShutdown flag to True so that if reactor
+        shutdown commences, the shutdown will be delayed until
+        deactivateDelayedShutdown is called.
         """
         self.delayedShutdown = True
 
 
     def deactivateDelayedShutdown(self):
         """
-        Call this when database initialization code has completed so that the
-        reactor can shutdown.
+        Call this when database initialization code has completed so
+        that the reactor can shutdown.
         """
         self.delayedShutdown = False
         if self.shutdownDeferred:
@@ -331,7 +332,7 @@
         if self.port:
             kwargs["host"] = "{}:{}".format(self.host, self.port)
 
-        return DBAPIConnector(pgdb, postgresPreflight, dsn, **kwargs)
+        return DBAPIConnector(postgres, postgresPreflight, dsn, **kwargs)
 
 
     def produceConnection(self, label="<unlabeled>", databaseName=None):
@@ -353,7 +354,7 @@
                 createDatabaseCursor.execute(
                     "drop database {}".format(self.databaseName)
                 )
-            except pgdb.DatabaseError:
+            except postgres.DatabaseError:
                 pass
 
         try:
@@ -420,9 +421,16 @@
         """
 
         def createConnection():
-            createDatabaseConn = self.produceConnection(
-                "schema creation", "postgres"
-            )
+            try:
+                createDatabaseConn = self.produceConnection(
+                    "schema creation", "postgres"
+                )
+            except postgres.DatabaseError as e:
+                log.error(
+                    "Unable to connect to database for schema creation: {error}",
+                    error=e
+                )
+                raise
             createDatabaseCursor = createDatabaseConn.cursor()
             createDatabaseCursor.execute("commit")
             return createDatabaseConn, createDatabaseCursor
@@ -465,6 +473,10 @@
             options.append("-c log_rotation_age=1440")
             options.append("-c logging_collector=on")
 
+        options.append("-c log_line_prefix=%t")
+        if self.testMode:
+            options.append("-c log_statement=all")
+
         log.warn(
             "Requesting postgres start via {cmd} {opts}",
             cmd=pgCtl, opts=options

Modified: CalendarServer/branches/users/cdaboo/pod2pod-migration/txdav/base/datastore/test/test_subpostgres.py
===================================================================
--- CalendarServer/branches/users/cdaboo/pod2pod-migration/txdav/base/datastore/test/test_subpostgres.py	2015-02-20 15:14:42 UTC (rev 14459)
+++ CalendarServer/branches/users/cdaboo/pod2pod-migration/txdav/base/datastore/test/test_subpostgres.py	2015-02-20 15:20:56 UTC (rev 14460)
@@ -29,6 +29,8 @@
 from twisted.internet.defer import inlineCallbacks, Deferred
 from twisted.application.service import Service
 
+
+
 class SubprocessStartup(TestCase):
     """
     Tests for starting and stopping the subprocess.
@@ -44,6 +46,7 @@
         """
 
         test = self
+
         class SimpleService1(Service):
 
             instances = []
@@ -82,7 +85,7 @@
         cursor = connection.cursor()
         cursor.execute("select * from test_dummy_table")
         values = cursor.fetchall()
-        self.assertEquals(values, [["dummy"]])
+        self.assertEquals(map(list, values), [["dummy"]])
 
 
     @inlineCallbacks
@@ -95,6 +98,7 @@
         """
 
         test = self
+
         class SimpleService2(Service):
 
             instances = []
@@ -134,7 +138,7 @@
         cursor = connection.cursor()
         cursor.execute("select * from test_dummy_table")
         values = cursor.fetchall()
-        self.assertEquals(values, [["dummy"]])
+        self.assertEquals(map(list, values), [["dummy"]])
 
 
     @inlineCallbacks
@@ -147,6 +151,7 @@
         """
 
         test = self
+
         class SimpleService1(Service):
 
             instances = []
@@ -171,8 +176,11 @@
                 finally:
                     cursor.close()
 
-        # The SQL in importFile.sql will get executed, including the insertion of "value1"
-        importFileName = CachingFilePath(__file__).parent().child("importFile.sql").path
+        # The SQL in importFile.sql will get executed, including the insertion
+        # of "value1"
+        importFileName = (
+            CachingFilePath(__file__).parent().child("importFile.sql").path
+        )
         svc = PostgresService(
             CachingFilePath("postgres_3.pgdb"),
             SimpleService1,
@@ -188,4 +196,4 @@
         cursor = connection.cursor()
         cursor.execute("select * from import_test_table")
         values = cursor.fetchall()
-        self.assertEquals(values, [["value1"], ["value2"]])
+        self.assertEquals(map(list, values), [["value1"], ["value2"]])

Modified: CalendarServer/branches/users/cdaboo/pod2pod-migration/txdav/caldav/datastore/scheduling/imip/test/test_outbound.py
===================================================================
--- CalendarServer/branches/users/cdaboo/pod2pod-migration/txdav/caldav/datastore/scheduling/imip/test/test_outbound.py	2015-02-20 15:14:42 UTC (rev 14459)
+++ CalendarServer/branches/users/cdaboo/pod2pod-migration/txdav/caldav/datastore/scheduling/imip/test/test_outbound.py	2015-02-20 15:20:56 UTC (rev 14460)
@@ -704,7 +704,7 @@
         """
         class StubElement(Element):
             loader = StringFormatTemplateLoader(
-                lambda : StringIO(
+                lambda: StringIO(
                     "<test><alpha>%(slot1)s</alpha>%(other)s</test>"
                 ),
                 "testRenderHere"
@@ -716,8 +716,10 @@
                                      other="world")
         result = []
         flattenString(None, StubElement()).addCallback(result.append)
-        self.assertEquals(result,
-                          ["<test><alpha>hello</alpha>world</test>"])
+        self.assertEquals(
+            list(result),
+            ["<test><alpha>hello</alpha>world</test>"]
+        )
 
 
     def test_templateLoaderWithAttributes(self):
@@ -728,7 +730,7 @@
         """
         class StubElement(Element):
             loader = StringFormatTemplateLoader(
-                lambda : StringIO(
+                lambda: StringIO(
                     '<test><alpha beta="before %(slot1)s after">inner</alpha>'
                     '%(other)s</test>'
                 ),
@@ -741,9 +743,13 @@
                                      other="world")
         result = []
         flattenString(None, StubElement()).addCallback(result.append)
-        self.assertEquals(result,
-                          ['<test><alpha beta="before hello after">'
-                           'inner</alpha>world</test>'])
+        self.assertEquals(
+            result,
+            [
+                '<test><alpha beta="before hello after">'
+                'inner</alpha>world</test>'
+            ]
+        )
 
 
     def test_templateLoaderTagSoup(self):
@@ -755,7 +761,7 @@
         """
         class StubElement(Element):
             loader = StringFormatTemplateLoader(
-                lambda : StringIO(
+                lambda: StringIO(
                     '<test><alpha beta="before %(slot1)s after">inner</alpha>'
                     '%(other)s'
                 ),

Modified: CalendarServer/branches/users/cdaboo/pod2pod-migration/txdav/carddav/datastore/sql.py
===================================================================
--- CalendarServer/branches/users/cdaboo/pod2pod-migration/txdav/carddav/datastore/sql.py	2015-02-20 15:14:42 UTC (rev 14459)
+++ CalendarServer/branches/users/cdaboo/pod2pod-migration/txdav/carddav/datastore/sql.py	2015-02-20 15:20:56 UTC (rev 14460)
@@ -991,15 +991,17 @@
     @inlineCallbacks
     def _groupForSharedAddressBookComponent(self):
 
-        n = self.viewerHome().uid()
-        fn = n
         uid = self._groupForSharedAddressBookUID()
+        record = yield self._txn.directoryService().recordWithUID(
+            self.viewerHome().uid().decode("utf-8")
+        )
+        n = record.shortNames[0]
+        fn = record.fullname if (
+            hasattr(record, "fullName") and record.fullname
+        ) else (
+            n
+        )
 
-        #  storebridge should substitute principal name and full name
-        #      owner = yield CalDAVResource.principalForUID(self.ownerHome().uid())
-        #      n = owner.name()
-        #      fn = owner.displayName()
-
         component = VCard.fromString(
             """BEGIN:VCARD
 VERSION:3.0

Modified: CalendarServer/branches/users/cdaboo/pod2pod-migration/txdav/carddav/datastore/test/test_sql.py
===================================================================
--- CalendarServer/branches/users/cdaboo/pod2pod-migration/txdav/carddav/datastore/test/test_sql.py	2015-02-20 15:14:42 UTC (rev 14459)
+++ CalendarServer/branches/users/cdaboo/pod2pod-migration/txdav/carddav/datastore/test/test_sql.py	2015-02-20 15:20:56 UTC (rev 14460)
@@ -580,7 +580,7 @@
 
         aboForeignMembers = schema.ABO_FOREIGN_MEMBERS
         foreignMemberRows = yield Select([aboForeignMembers.GROUP_ID, aboForeignMembers.MEMBER_ADDRESS], From=aboForeignMembers).on(txn)
-        self.assertEqual(foreignMemberRows, [[groupObject._resourceID, "urn:uuid:uid3"]])
+        self.assertEqual(map(list, foreignMemberRows), [[groupObject._resourceID, "urn:uuid:uid3"]])
 
         subgroup = VCard.fromString(
             """BEGIN:VCARD
@@ -598,10 +598,13 @@
         subgroupObject = yield adbk.createAddressBookObjectWithName("sg.vcf", subgroup)
 
         memberRows = yield Select([aboMembers.GROUP_ID, aboMembers.MEMBER_ID], From=aboMembers, Where=aboMembers.REMOVED == False).on(txn)
-        self.assertEqual(sorted(memberRows), sorted([
-            [groupObject._resourceID, subgroupObject._resourceID],
-            [subgroupObject._resourceID, personObject._resourceID],
-        ]))
+        self.assertEqual(
+            map(list, sorted(memberRows)),
+            sorted([
+                [groupObject._resourceID, subgroupObject._resourceID],
+                [subgroupObject._resourceID, personObject._resourceID],
+            ])
+        )
 
         foreignMemberRows = yield Select([aboForeignMembers.GROUP_ID, aboForeignMembers.MEMBER_ADDRESS], From=aboForeignMembers).on(txn)
         self.assertEqual(foreignMemberRows, [])
@@ -627,7 +630,10 @@
         foreignMemberRows = yield Select(
             [aboForeignMembers.GROUP_ID, aboForeignMembers.MEMBER_ADDRESS], From=aboForeignMembers,
         ).on(txn)
-        self.assertEqual(foreignMemberRows, [[groupObject._resourceID, "urn:uuid:uid3"]])
+        self.assertEqual(
+            map(list, foreignMemberRows),
+            [[groupObject._resourceID, "urn:uuid:uid3"]]
+        )
 
         yield home.removeAddressBookWithName("addressbook")
         yield txn.commit()

Modified: CalendarServer/branches/users/cdaboo/pod2pod-migration/txdav/common/datastore/test/test_sql.py
===================================================================
--- CalendarServer/branches/users/cdaboo/pod2pod-migration/txdav/common/datastore/test/test_sql.py	2015-02-20 15:14:42 UTC (rev 14459)
+++ CalendarServer/branches/users/cdaboo/pod2pod-migration/txdav/common/datastore/test/test_sql.py	2015-02-20 15:20:56 UTC (rev 14460)
@@ -92,8 +92,10 @@
         self.patch(self.store, "logTransactionWaits", 1)
 
         ctr = [0]
+
         def counter(*args, **kwargs):
             ctr[0] += 1
+
         self.patch(log, "error", counter)
 
         txn = self.transactionUnderTest()
@@ -115,8 +117,10 @@
         self.patch(self.store, "timeoutTransactions", 1)
 
         ctr = [0]
+
         def counter(*args, **kwargs):
             ctr[0] += 1
+
         self.patch(log, "error", counter)
 
         txn = self.transactionUnderTest()
@@ -130,7 +134,8 @@
 
     def test_logWaitsAndTxnTimeout(self):
         """
-        CommonStoreTransactionMonitor logs waiting transactions and terminates long transactions.
+        CommonStoreTransactionMonitor logs waiting transactions and terminates
+        long transactions.
         """
 
         c = Clock()
@@ -141,11 +146,13 @@
         self.patch(self.store, "timeoutTransactions", 2)
 
         ctr = [0, 0]
+
         def counter(logStr, *args, **kwargs):
             if "wait" in logStr:
                 ctr[0] += 1
             elif "abort" in logStr:
                 ctr[1] += 1
+
         self.patch(log, "error", counter)
 
         txn = self.transactionUnderTest()
@@ -270,11 +277,13 @@
         cs = schema.CALENDARSERVER
         yield Select([cs.VALUE], From=cs).on(txn)
         waitAMoment = Deferred()
+
         @inlineCallbacks
         def later(subtxn):
             yield waitAMoment
             value = yield Select([cs.VALUE], From=cs).on(subtxn)
             returnValue(value)
+
         started = txn.subtransaction(later)
         txn.abort()
         waitAMoment.callback(True)
@@ -365,15 +374,23 @@
         from txdav.common.datastore.sql import _normalizeColumnUUIDs
         yield _normalizeColumnUUIDs(txn, rp.VIEWER_UID)
         self.assertEqual(
-            (yield Select(
-                [rp.RESOURCE_ID, rp.NAME,
-                    rp.VALUE, rp.VIEWER_UID],
-                From=rp,
-                OrderBy=rp.RESOURCE_ID, Ascending=True,
-            ).on(txn)),
-            [[1, "asdf", "property-value", "not-a-uuid"],
-             [2, "fdsa", "another-value",
-              "AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA"]]
+            map(
+                list,
+                (
+                    yield Select(
+                        [rp.RESOURCE_ID, rp.NAME, rp.VALUE, rp.VIEWER_UID],
+                        From=rp,
+                        OrderBy=rp.RESOURCE_ID, Ascending=True,
+                    ).on(txn)
+                )
+            ),
+            [
+                [1, "asdf", "property-value", "not-a-uuid"],
+                [
+                    2, "fdsa",
+                    "another-value", "AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA"
+                ]
+            ]
         )
 
 
@@ -399,7 +416,10 @@
         yield t1.calendarHomeWithUID(denormalizedUID, create=True)
         yield self.commit()
         yield fixUUIDNormalization(self.storeUnderTest())
-        self.assertEqual((yield self.allHomeUIDs()), [[normalizedUID]])
+        self.assertEqual(
+            map(list, (yield self.allHomeUIDs())),
+            [[normalizedUID]]
+        )
 
 
     @inlineCallbacks
@@ -413,8 +433,10 @@
         yield t1.notificationsWithUID(denormalizedUID, create=True)
         yield self.commit()
         yield fixUUIDNormalization(self.storeUnderTest())
-        self.assertEqual((yield self.allHomeUIDs(schema.NOTIFICATION_HOME)),
-                         [[normalizedUID]])
+        self.assertEqual(
+            map(list, (yield self.allHomeUIDs(schema.NOTIFICATION_HOME))),
+            [[normalizedUID]]
+        )
 
 
     @inlineCallbacks
@@ -428,8 +450,10 @@
         yield t1.addressbookHomeWithUID(denormalizedUID, create=True)
         yield self.commit()
         yield fixUUIDNormalization(self.storeUnderTest())
-        self.assertEqual((yield self.allHomeUIDs(schema.ADDRESSBOOK_HOME)),
-                         [[normalizedUID]])
+        self.assertEqual(
+            map(list, (yield self.allHomeUIDs(schema.ADDRESSBOOK_HOME))),
+            [[normalizedUID]]
+        )
 
 
     @inlineCallbacks

Modified: CalendarServer/branches/users/cdaboo/pod2pod-migration/txdav/common/datastore/upgrade/sql/test/test_upgrade_with_data.py
===================================================================
--- CalendarServer/branches/users/cdaboo/pod2pod-migration/txdav/common/datastore/upgrade/sql/test/test_upgrade_with_data.py	2015-02-20 15:14:42 UTC (rev 14459)
+++ CalendarServer/branches/users/cdaboo/pod2pod-migration/txdav/common/datastore/upgrade/sql/test/test_upgrade_with_data.py	2015-02-20 15:20:56 UTC (rev 14460)
@@ -175,7 +175,7 @@
         self.assertEqual(len(schedules), 1)
         self.assertEqual(len(replies), 1)
 
-        self.assertEqual(replies[0], [1, 1, None, cal1, ])
+        self.assertEqual(list(replies[0]), [1, 1, None, cal1, ])
 
 
     @inlineCallbacks
@@ -271,4 +271,4 @@
         self.assertEqual(len(schedules), 1)
         self.assertEqual(len(replies), 1)
 
-        self.assertEqual(replies[0], [1, 1, 3, None, ])
+        self.assertEqual(list(replies[0]), [1, 1, 3, None, ])
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20150220/7b1e8db0/attachment-0001.html>


More information about the calendarserver-changes mailing list