[CalendarServer-changes] [12856] twext/trunk/twext/who/opendirectory/_service.py

source_changes at macosforge.org source_changes at macosforge.org
Fri Mar 7 16:50:40 PST 2014


Revision: 12856
          http://trac.calendarserver.org//changeset/12856
Author:   wsanchez at apple.com
Date:     2014-03-07 16:50:40 -0800 (Fri, 07 Mar 2014)
Log Message:
-----------
Be more specific about the exception we're catching.
Symbol names matter (to observers) in logging; don't be obtuse.

Modified Paths:
--------------
    twext/trunk/twext/who/opendirectory/_service.py

Modified: twext/trunk/twext/who/opendirectory/_service.py
===================================================================
--- twext/trunk/twext/who/opendirectory/_service.py	2014-03-08 00:46:25 UTC (rev 12855)
+++ twext/trunk/twext/who/opendirectory/_service.py	2014-03-08 00:50:40 UTC (rev 12856)
@@ -546,18 +546,19 @@
                 MatchExpression(self.fieldName.shortNames, shortName),
                 recordType=recordType
             )
+            results = yield self._recordsFromQuery(query)
+
             try:
-                results = yield self._recordsFromQuery(query)
                 record = uniqueResult(results)
-                returnValue(record)
             except DirectoryServiceError:
                 self.log.error(
-                    "Duplicate records for name: {n} ({rt})".format(
-                        n=shortName, rt=recordType.name
-                    )
+                    "Duplicate records for name: {name} ({recordType})"
+                    .format(name=shortName, recordType=recordType.name)
                 )
                 raise
 
+            returnValue(record)
+
         except QueryNotSupportedError:
             # Let the superclass try
             returnValue((yield BaseDirectoryService.recordWithShortName(
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140307/bcde9bc2/attachment-0001.html>


More information about the calendarserver-changes mailing list