Revision
9278
Author
glyph@apple.com
Date
2012-05-24 13:33:47 -0700 (Thu, 24 May 2012)

Log Message

For now, normalize UUIDs in augments XML database whenever it's opened.  Also, don't use 'OrNot' version of normalization since there are no urn:uuid:s in there.

Modified Paths

Diff

Modified: CalendarServer/branches/users/glyph/uuid-normalize/twistedcaldav/directory/augment.py (9277 => 9278)


--- CalendarServer/branches/users/glyph/uuid-normalize/twistedcaldav/directory/augment.py	2012-05-24 20:33:44 UTC (rev 9277)
+++ CalendarServer/branches/users/glyph/uuid-normalize/twistedcaldav/directory/augment.py	2012-05-24 20:33:47 UTC (rev 9278)
@@ -31,6 +31,7 @@
 from twistedcaldav.directory.xmlaugmentsparser import XMLAugmentsParser
 from twistedcaldav.xmlutil import newElementTreeWithRoot, addSubElement,\
     writeXML, readXML
+from twistedcaldav.directory.util import normalizeUUID
 
 
 log = Logger()
@@ -98,11 +99,10 @@
         @return: a L{Deferred} that fires when all records have been
             normalized.
         """
-        from txdav.base.datastore.util import normalizeUUIDOrNot
         remove = []
         add = []
         for uid in (yield self.getAllUIDs()):
-            nuid = normalizeUUIDOrNot(uid)
+            nuid = normalizeUUID(uid)
             if uid != nuid:
                 old = yield self._lookupAugmentRecord(uid)
                 new = copy.deepcopy(old)
@@ -266,6 +266,7 @@
             raise
 
         self.lastCached = time.time()
+        self.normalizeUUIDs()
 
 
     def getAllUIDs(self):