[CalendarServer-changes] [6239] CalendarServer/trunk/txdav/common/datastore/file.py

source_changes at macosforge.org source_changes at macosforge.org
Fri Sep 3 12:11:31 PDT 2010


Revision: 6239
          http://trac.macosforge.org/projects/calendarserver/changeset/6239
Author:   sagen at apple.com
Date:     2010-09-03 12:11:30 -0700 (Fri, 03 Sep 2010)
Log Message:
-----------
Skip missing directories in _homesOfType

Modified Paths:
--------------
    CalendarServer/trunk/txdav/common/datastore/file.py

Modified: CalendarServer/trunk/txdav/common/datastore/file.py
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/file.py	2010-09-03 18:59:39 UTC (rev 6238)
+++ CalendarServer/trunk/txdav/common/datastore/file.py	2010-09-03 19:11:30 UTC (rev 6239)
@@ -105,19 +105,20 @@
         @param storeType: one of L{EADDRESSBOOKTYPE} or L{ECALENDARTYPE}.
         """
         top = self._path.child(TOPPATHS[storeType]).child(UIDPATH)
-        for firstPrefix in top.children():
-            if not isValidName(firstPrefix.basename()):
-                continue
-            for secondPrefix in firstPrefix.children():
-                if not isValidName(secondPrefix.basename()):
+        if top.exists() and top.isdir():
+            for firstPrefix in top.children():
+                if not isValidName(firstPrefix.basename()):
                     continue
-                for actualHome in secondPrefix.children():
-                    uid = actualHome.basename()
-                    if not isValidName(uid):
+                for secondPrefix in firstPrefix.children():
+                    if not isValidName(secondPrefix.basename()):
                         continue
-                    txn = self.newTransaction("enumerate home %r" % (uid,))
-                    home = txn.homeWithUID(storeType, uid, False)
-                    yield (txn, home)
+                    for actualHome in secondPrefix.children():
+                        uid = actualHome.basename()
+                        if not isValidName(uid):
+                            continue
+                        txn = self.newTransaction("enumerate home %r" % (uid,))
+                        home = txn.homeWithUID(storeType, uid, False)
+                        yield (txn, home)
 
 
     def eachCalendarHome(self):
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100903/61982863/attachment.html>


More information about the calendarserver-changes mailing list