[CalendarServer-changes] [9329] CalendarServer/trunk/calendarserver/tools/shell/cmd.py
source_changes at macosforge.org
source_changes at macosforge.org
Mon Jun 4 16:00:55 PDT 2012
Revision: 9329
http://trac.macosforge.org/projects/calendarserver/changeset/9329
Author: wsanchez at apple.com
Date: 2012-06-04 16:00:54 -0700 (Mon, 04 Jun 2012)
Log Message:
-----------
directoryRecordWithID() takes type:name ids.
Fix None record handling in cmd_purge_principals.
Modified Paths:
--------------
CalendarServer/trunk/calendarserver/tools/shell/cmd.py
Modified: CalendarServer/trunk/calendarserver/tools/shell/cmd.py
===================================================================
--- CalendarServer/trunk/calendarserver/tools/shell/cmd.py 2012-06-04 22:41:14 UTC (rev 9328)
+++ CalendarServer/trunk/calendarserver/tools/shell/cmd.py 2012-06-04 23:00:54 UTC (rev 9329)
@@ -125,7 +125,12 @@
if not record:
# Try type:name form
- pass
+ try:
+ recordType, shortName = id.split(":")
+ except ValueError:
+ pass
+ else:
+ record = directory.recordWithShortName(recordType, shortName)
return record
@@ -616,9 +621,9 @@
records = []
for id in tokens:
record = self.directoryRecordWithID(id)
- if record:
- records.append(record)
- else:
+ records.append(record)
+
+ if not record:
self.terminal.write("Unknown UID: %s\n" % (id,))
if None in records:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120604/616c322f/attachment.html>
More information about the calendarserver-changes
mailing list