<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[13517] CalendarServer/trunk/txdav/caldav/datastore/scheduling</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.calendarserver.org//changeset/13517">13517</a></dd>
<dt>Author</dt> <dd>cdaboo@apple.com</dd>
<dt>Date</dt> <dd>2014-05-20 11:50:48 -0700 (Tue, 20 May 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Fix some ischedule/dkim issues. Change % -&gt; format style strs/logging.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServertrunktxdavcaldavdatastoreschedulingcaldavdeliverypy">CalendarServer/trunk/txdav/caldav/datastore/scheduling/caldav/delivery.py</a></li>
<li><a href="#CalendarServertrunktxdavcaldavdatastoreschedulingcaldavschedulerpy">CalendarServer/trunk/txdav/caldav/datastore/scheduling/caldav/scheduler.py</a></li>
<li><a href="#CalendarServertrunktxdavcaldavdatastoreschedulingcuaddresspy">CalendarServer/trunk/txdav/caldav/datastore/scheduling/cuaddress.py</a></li>
<li><a href="#CalendarServertrunktxdavcaldavdatastoreschedulingdeliverypy">CalendarServer/trunk/txdav/caldav/datastore/scheduling/delivery.py</a></li>
<li><a href="#CalendarServertrunktxdavcaldavdatastoreschedulingimipdeliverypy">CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/delivery.py</a></li>
<li><a href="#CalendarServertrunktxdavcaldavdatastoreschedulingimipsmtpsenderpy">CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/smtpsender.py</a></li>
<li><a href="#CalendarServertrunktxdavcaldavdatastoreschedulingischeduledeliverypy">CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/delivery.py</a></li>
<li><a href="#CalendarServertrunktxdavcaldavdatastoreschedulingischeduledkimpy">CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/dkim.py</a></li>
<li><a href="#CalendarServertrunktxdavcaldavdatastoreschedulingischedulelocalserverspy">CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/localservers.py</a></li>
<li><a href="#CalendarServertrunktxdavcaldavdatastoreschedulingischeduleremoteserverspy">CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/remoteservers.py</a></li>
<li><a href="#CalendarServertrunktxdavcaldavdatastoreschedulingischeduleresourcepy">CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/resource.py</a></li>
<li><a href="#CalendarServertrunktxdavcaldavdatastoreschedulingischeduleschedulerpy">CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/scheduler.py</a></li>
<li><a href="#CalendarServertrunktxdavcaldavdatastoreschedulingischeduletestdatadbexamplecom">CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/test/data/db.example.com</a></li>
<li><a href="#CalendarServertrunktxdavcaldavdatastoreschedulingischeduleutilspy">CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/utils.py</a></li>
<li><a href="#CalendarServertrunktxdavcaldavdatastoreschedulingischedulexmlpy">CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/xml.py</a></li>
<li><a href="#CalendarServertrunktxdavcaldavdatastoreschedulingschedulerpy">CalendarServer/trunk/txdav/caldav/datastore/scheduling/scheduler.py</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServertrunktxdavcaldavdatastoreschedulingcaldavdeliverypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/caldav/delivery.py (13516 => 13517)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/caldav/delivery.py        2014-05-20 18:49:22 UTC (rev 13516)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/caldav/delivery.py        2014-05-20 18:50:48 UTC (rev 13517)
</span><span class="lines">@@ -121,7 +121,7 @@
</span><span class="cx">     @inlineCallbacks
</span><span class="cx">     def generateResponse(self, recipient, responses):
</span><span class="cx">         # Hash the iCalendar data for use as the last path element of the URI path
</span><del>-        name = &quot;%s-%s.ics&quot; % (hashlib.md5(self.scheduler.calendar.resourceUID()).hexdigest(), str(uuid.uuid4())[:8],)
</del><ins>+        name = &quot;{hash}-{r}.ics&quot;.format(hash=hashlib.md5(self.scheduler.calendar.resourceUID()).hexdigest(), r=str(uuid.uuid4())[:8],)
</ins><span class="cx"> 
</span><span class="cx">         # Do implicit scheduling message processing.
</span><span class="cx">         try:
</span></span></pre></div>
<a id="CalendarServertrunktxdavcaldavdatastoreschedulingcaldavschedulerpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/caldav/scheduler.py (13516 => 13517)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/caldav/scheduler.py        2014-05-20 18:49:22 UTC (rev 13516)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/caldav/scheduler.py        2014-05-20 18:50:48 UTC (rev 13517)
</span><span class="lines">@@ -78,7 +78,10 @@
</span><span class="cx">     def checkAuthorization(self):
</span><span class="cx">         # Must have an authenticated user
</span><span class="cx">         if not self.internal_request and self.originator_uid == None:
</span><del>-            log.error(&quot;Unauthenticated originators not allowed: %s&quot; % (self.originator,))
</del><ins>+            log.error(
+                &quot;Unauthenticated originators not allowed: {o}&quot;,
+                o=self.originator,
+            )
</ins><span class="cx">             raise HTTPError(self.errorResponse(
</span><span class="cx">                 responsecode.FORBIDDEN,
</span><span class="cx">                 self.errorElements[&quot;originator-denied&quot;],
</span><span class="lines">@@ -96,7 +99,10 @@
</span><span class="cx">         originatorAddress = yield calendarUserFromCalendarUserAddress(self.originator, self.txn)
</span><span class="cx">         if not originatorAddress.hosted():
</span><span class="cx">             # Local requests MUST have a principal.
</span><del>-            log.error(&quot;Could not find principal for originator: %s&quot; % (self.originator,))
</del><ins>+            log.error(
+                &quot;Could not find principal for originator: {o}&quot;,
+                o=self.originator,
+            )
</ins><span class="cx">             raise HTTPError(self.errorResponse(
</span><span class="cx">                 responsecode.FORBIDDEN,
</span><span class="cx">                 self.errorElements[&quot;originator-denied&quot;],
</span><span class="lines">@@ -104,7 +110,10 @@
</span><span class="cx">             ))
</span><span class="cx">         else:
</span><span class="cx">             if not originatorAddress.validOriginator() or isinstance(originatorAddress, OtherServerCalendarUser):
</span><del>-                log.error(&quot;Originator not enabled or hosted on this server: %s&quot; % (self.originator,))
</del><ins>+                log.error(
+                    &quot;Originator not enabled or hosted on this server: {o}&quot;,
+                    o=self.originator,
+                )
</ins><span class="cx">                 raise HTTPError(self.errorResponse(
</span><span class="cx">                     responsecode.FORBIDDEN,
</span><span class="cx">                     self.errorElements[&quot;originator-denied&quot;],
</span><span class="lines">@@ -131,7 +140,7 @@
</span><span class="cx">             # user. Also if server-to-server is not enabled then remote addresses are not allowed.
</span><span class="cx">             if not recipientAddress.hosted():
</span><span class="cx">                 if isinstance(recipientAddress, InvalidCalendarUser):
</span><del>-                    log.error(&quot;Unknown calendar user address: %s&quot; % (recipient,))
</del><ins>+                    log.error(&quot;Unknown calendar user address: {r}&quot;, r=recipient,)
</ins><span class="cx">                 results.append(recipientAddress)
</span><span class="cx">             else:
</span><span class="cx">                 # Map recipient to their inbox and cache on calendar user object
</span><span class="lines">@@ -148,7 +157,7 @@
</span><span class="cx">                 if inbox:
</span><span class="cx">                     results.append(recipientAddress)
</span><span class="cx">                 else:
</span><del>-                    log.error(&quot;No scheduling for calendar user: %s&quot; % (recipient,))
</del><ins>+                    log.error(&quot;No scheduling for calendar user: {r}&quot;, r=recipient,)
</ins><span class="cx">                     results.append(InvalidCalendarUser(recipient))
</span><span class="cx"> 
</span><span class="cx">         self.recipients = results
</span><span class="lines">@@ -171,7 +180,7 @@
</span><span class="cx">                     # to be handled later when we know whether a new invite is being added
</span><span class="cx">                     # (which we reject) vs an update to an existing one (which we allow).
</span><span class="cx">                     if self.checkForFreeBusy() and not organizerAddress.record.enabledAsOrganizer():
</span><del>-                        log.error(&quot;ORGANIZER not allowed to be an Organizer: %s&quot; % (self.calendar,))
</del><ins>+                        log.error(&quot;ORGANIZER not allowed to be an Organizer: {cal}&quot;, cal=self.calendar,)
</ins><span class="cx">                         raise HTTPError(self.errorResponse(
</span><span class="cx">                             responsecode.FORBIDDEN,
</span><span class="cx">                             self.errorElements[&quot;organizer-denied&quot;],
</span><span class="lines">@@ -180,7 +189,7 @@
</span><span class="cx"> 
</span><span class="cx">                     self.organizer = organizerAddress
</span><span class="cx">                 else:
</span><del>-                    log.error(&quot;No scheduling for ORGANIZER: %s&quot; % (organizer,))
</del><ins>+                    log.error(&quot;No scheduling for ORGANIZER: {o}&quot;, o=organizer,)
</ins><span class="cx">                     raise HTTPError(self.errorResponse(
</span><span class="cx">                         responsecode.FORBIDDEN,
</span><span class="cx">                         self.errorElements[&quot;organizer-denied&quot;],
</span><span class="lines">@@ -189,7 +198,7 @@
</span><span class="cx">             else:
</span><span class="cx">                 localUser = (yield addressmapping.mapper.isCalendarUserInMyDomain(organizer))
</span><span class="cx">                 if localUser:
</span><del>-                    log.error(&quot;No principal for ORGANIZER in calendar data: %s&quot; % (self.calendar,))
</del><ins>+                    log.error(&quot;No principal for ORGANIZER in calendar data: {cal}&quot;, cal=self.calendar,)
</ins><span class="cx">                     raise HTTPError(self.errorResponse(
</span><span class="cx">                         responsecode.FORBIDDEN,
</span><span class="cx">                         self.errorElements[&quot;organizer-denied&quot;],
</span><span class="lines">@@ -198,7 +207,7 @@
</span><span class="cx">                 else:
</span><span class="cx">                     self.organizer = organizerAddress
</span><span class="cx">         else:
</span><del>-            log.error(&quot;ORGANIZER missing in calendar data: %s&quot; % (self.calendar,))
</del><ins>+            log.error(&quot;ORGANIZER missing in calendar data: {cal}&quot;, cal=self.calendar,)
</ins><span class="cx">             raise HTTPError(self.errorResponse(
</span><span class="cx">                 responsecode.FORBIDDEN,
</span><span class="cx">                 self.errorElements[&quot;invalid-scheduling-message&quot;],
</span><span class="lines">@@ -210,7 +219,7 @@
</span><span class="cx"> 
</span><span class="cx">         # Make sure that the ORGANIZER is local
</span><span class="cx">         if not isinstance(self.organizer, LocalCalendarUser):
</span><del>-            log.error(&quot;ORGANIZER is not local to server in calendar data: %s&quot; % (self.calendar,))
</del><ins>+            log.error(&quot;ORGANIZER is not local to server in calendar data: {cal}&quot;, cal=self.calendar,)
</ins><span class="cx">             raise HTTPError(self.errorResponse(
</span><span class="cx">                 responsecode.FORBIDDEN,
</span><span class="cx">                 self.errorElements[&quot;organizer-denied&quot;],
</span><span class="lines">@@ -219,7 +228,7 @@
</span><span class="cx"> 
</span><span class="cx">         # Make sure that the ORGANIZER's is the request URI owner
</span><span class="cx">         if self.doingPOST is not None and self.organizer.record.uid != self.originator_uid:
</span><del>-            log.error(&quot;Wrong outbox for ORGANIZER in calendar data: %s&quot; % (self.calendar,))
</del><ins>+            log.error(&quot;Wrong outbox for ORGANIZER in calendar data: {cal}&quot;, cal=self.calendar,)
</ins><span class="cx">             raise HTTPError(self.errorResponse(
</span><span class="cx">                 responsecode.FORBIDDEN,
</span><span class="cx">                 self.errorElements[&quot;organizer-denied&quot;],
</span><span class="lines">@@ -238,14 +247,14 @@
</span><span class="cx">         attendeeAddress = yield calendarUserFromCalendarUserAddress(self.attendee, self.txn)
</span><span class="cx">         if attendeeAddress.hosted():
</span><span class="cx">             if self.doingPOST is not None and attendeeAddress.record.uid != self.originator_uid:
</span><del>-                log.error(&quot;ATTENDEE in calendar data does not match owner of Outbox: %s&quot; % (self.attendee,))
</del><ins>+                log.error(&quot;ATTENDEE in calendar data does not match owner of Outbox: {a}&quot;, a=self.attendee,)
</ins><span class="cx">                 raise HTTPError(self.errorResponse(
</span><span class="cx">                     responsecode.FORBIDDEN,
</span><span class="cx">                     self.errorElements[&quot;attendee-denied&quot;],
</span><span class="cx">                     &quot;Outbox does not belong to attendee&quot;,
</span><span class="cx">                 ))
</span><span class="cx">         else:
</span><del>-            log.error(&quot;Unknown ATTENDEE in calendar data: %s&quot; % (self.attendee,))
</del><ins>+            log.error(&quot;Unknown ATTENDEE in calendar data: {a}&quot;, a=self.attendee,)
</ins><span class="cx">             raise HTTPError(self.errorResponse(
</span><span class="cx">                 responsecode.FORBIDDEN,
</span><span class="cx">                 self.errorElements[&quot;attendee-denied&quot;],
</span></span></pre></div>
<a id="CalendarServertrunktxdavcaldavdatastoreschedulingcuaddresspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/cuaddress.py (13516 => 13517)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/cuaddress.py        2014-05-20 18:49:22 UTC (rev 13516)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/cuaddress.py        2014-05-20 18:50:48 UTC (rev 13517)
</span><span class="lines">@@ -118,7 +118,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     def __str__(self):
</span><del>-        return &quot;Local calendar user: %s&quot; % (self.cuaddr,)
</del><ins>+        return &quot;Local calendar user: {}&quot;.format(self.cuaddr)
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -132,7 +132,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     def __str__(self):
</span><del>-        return &quot;Other server calendar user: %s&quot; % (self.cuaddr,)
</del><ins>+        return &quot;Other server calendar user: {}&quot;.format(self.cuaddr)
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -147,7 +147,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     def __str__(self):
</span><del>-        return &quot;Remote calendar user: %s&quot; % (self.cuaddr,)
</del><ins>+        return &quot;Remote calendar user: {}&quot;.format(self.cuaddr)
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     def extractDomain(self):
</span><span class="lines">@@ -171,7 +171,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     def __str__(self):
</span><del>-        return &quot;Email/iMIP calendar user: %s&quot; % (self.cuaddr,)
</del><ins>+        return &quot;Email/iMIP calendar user: {}&quot;.format(self.cuaddr)
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -182,7 +182,7 @@
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx">     def __str__(self):
</span><del>-        return &quot;Invalid calendar user: %s&quot; % (self.cuaddr,)
</del><ins>+        return &quot;Invalid calendar user: {}&quot;.format(self.cuaddr)
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     def validOriginator(self):
</span></span></pre></div>
<a id="CalendarServertrunktxdavcaldavdatastoreschedulingdeliverypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/delivery.py (13516 => 13517)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/delivery.py        2014-05-20 18:49:22 UTC (rev 13516)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/delivery.py        2014-05-20 18:50:48 UTC (rev 13517)
</span><span class="lines">@@ -69,7 +69,11 @@
</span><span class="cx">                 if re.match(pattern, cuaddr) is not None:
</span><span class="cx">                     return succeed(True)
</span><span class="cx">             except re.error:
</span><del>-                log.error(&quot;Invalid regular expression for Scheduling configuration '%s/LocalAddresses': %s&quot; % (cls.serviceType(), pattern,))
</del><ins>+                log.error(
+                    &quot;Invalid regular expression for Scheduling configuration '{stype}/LocalAddresses': {pat}&quot;,
+                    stype=cls.serviceType(),
+                    pat=pattern,
+                )
</ins><span class="cx"> 
</span><span class="cx">         return succeed(False)
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServertrunktxdavcaldavdatastoreschedulingimipdeliverypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/delivery.py (13516 => 13517)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/delivery.py        2014-05-20 18:49:22 UTC (rev 13516)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/delivery.py        2014-05-20 18:50:48 UTC (rev 13517)
</span><span class="lines">@@ -76,12 +76,15 @@
</span><span class="cx">                 &quot;CANCEL&quot;,
</span><span class="cx">                 &quot;DECLINE_COUNTER&quot;,
</span><span class="cx">             ):
</span><del>-                log.info(&quot;Could not do server-to-imip method: %s&quot; % (method,))
</del><ins>+                log.info(
+                    &quot;Could not do server-to-imip method: {method}&quot;,
+                    method=method,
+                )
</ins><span class="cx">                 for recipient in self.recipients:
</span><span class="cx">                     err = HTTPError(ErrorResponse(
</span><span class="cx">                         responsecode.FORBIDDEN,
</span><span class="cx">                         (caldav_namespace, &quot;recipient-failed&quot;),
</span><del>-                        &quot;iMIP method not allowed: %s&quot; % (method,),
</del><ins>+                        &quot;iMIP method not allowed: {}&quot;.format(method,),
</ins><span class="cx">                     ))
</span><span class="cx">                     self.responses.add(
</span><span class="cx">                         recipient.cuaddr,
</span><span class="lines">@@ -96,11 +99,16 @@
</span><span class="cx">                 try:
</span><span class="cx">                     toAddr = str(recipient.cuaddr)
</span><span class="cx">                     if not toAddr.lower().startswith(&quot;mailto:&quot;):
</span><del>-                        raise ValueError(&quot;ATTENDEE address '%s' must be mailto: for iMIP operation.&quot; % (toAddr,))
</del><ins>+                        raise ValueError(&quot;ATTENDEE address '{}' must be mailto: for iMIP operation.&quot;.format(toAddr,))
</ins><span class="cx"> 
</span><span class="cx">                     fromAddr = str(self.scheduler.originator.cuaddr)
</span><span class="cx"> 
</span><del>-                    log.debug(&quot;Submitting iMIP message...  To: '%s', From :'%s'\n%s&quot; % (toAddr, fromAddr, caldata,))
</del><ins>+                    log.debug(
+                        &quot;Submitting iMIP message...  To: '{to}', From :'{fr}'\n{data}&quot;,
+                        to=toAddr,
+                        fr=fromAddr,
+                        data=caldata,
+                    )
</ins><span class="cx"> 
</span><span class="cx">                     def enqueueOp(txn):
</span><span class="cx">                         return txn.enqueue(IMIPInvitationWork, fromAddr=fromAddr,
</span><span class="lines">@@ -108,14 +116,19 @@
</span><span class="cx"> 
</span><span class="cx">                     yield inTransaction(
</span><span class="cx">                         lambda: self.scheduler.txn.store().newTransaction(
</span><del>-                            &quot;Submitting iMIP message for UID: %s&quot; % (
</del><ins>+                            &quot;Submitting iMIP message for UID: {}&quot;.format(
</ins><span class="cx">                             self.scheduler.calendar.resourceUID(),)),
</span><span class="cx">                         enqueueOp
</span><span class="cx">                     )
</span><span class="cx"> 
</span><span class="cx">                 except Exception, e:
</span><span class="cx">                     # Generated failed response for this recipient
</span><del>-                    log.debug(&quot;iMIP request %s failed for recipient %s: %s&quot; % (self, recipient, e))
</del><ins>+                    log.debug(
+                        &quot;iMIP request {req} failed for recipient {r}: {exc}&quot;,
+                        req=self,
+                        r=recipient,
+                        exc=e,
+                    )
</ins><span class="cx">                     failForRecipient(recipient)
</span><span class="cx"> 
</span><span class="cx">                 else:
</span><span class="lines">@@ -127,6 +140,6 @@
</span><span class="cx"> 
</span><span class="cx">         except Exception, e:
</span><span class="cx">             # Generated failed responses for each recipient
</span><del>-            log.debug(&quot;iMIP request %s failed: %s&quot; % (self, e))
</del><ins>+            log.debug(&quot;iMIP request {req} failed: {exc}&quot;, req=self, exc=e)
</ins><span class="cx">             for recipient in self.recipients:
</span><span class="cx">                 failForRecipient(recipient)
</span></span></pre></div>
<a id="CalendarServertrunktxdavcaldavdatastoreschedulingimipsmtpsenderpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/smtpsender.py (13516 => 13517)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/smtpsender.py        2014-05-20 18:49:22 UTC (rev 13516)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/smtpsender.py        2014-05-20 18:50:48 UTC (rev 13517)
</span><span class="lines">@@ -40,17 +40,24 @@
</span><span class="cx"> 
</span><span class="cx">     def sendMessage(self, fromAddr, toAddr, msgId, message):
</span><span class="cx"> 
</span><del>-        log.debug(&quot;Sending: %s&quot; % (message,))
</del><ins>+        log.debug(&quot;Sending: {msg}&quot;, msg=message)
</ins><span class="cx">         def _success(result, msgId, fromAddr, toAddr):
</span><del>-            log.info(&quot;Sent IMIP message %s from %s to %s&quot; %
-                (msgId, fromAddr, toAddr))
</del><ins>+            log.info(
+                &quot;Sent IMIP message {id} from {fr} to {to}&quot;,
+                id=msgId,
+                fr=fromAddr,
+                to=toAddr,
+            )
</ins><span class="cx">             return True
</span><span class="cx"> 
</span><span class="cx">         def _failure(failure, msgId, fromAddr, toAddr):
</span><del>-            log.error(&quot;Failed to send IMIP message %s from %s &quot;
-                           &quot;to %s (Reason: %s)&quot; %
-                           (msgId, fromAddr, toAddr,
-                            failure.getErrorMessage()))
</del><ins>+            log.error(
+                &quot;Failed to send IMIP message {id} from {fr} to {to} (Reason: {err})&quot;,
+                id=msgId,
+                fr=fromAddr,
+                to=toAddr,
+                err=failure.getErrorMessage(),
+            )
</ins><span class="cx">             return False
</span><span class="cx"> 
</span><span class="cx">         deferred = defer.Deferred()
</span></span></pre></div>
<a id="CalendarServertrunktxdavcaldavdatastoreschedulingischeduledeliverypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/delivery.py (13516 => 13517)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/delivery.py        2014-05-20 18:49:22 UTC (rev 13516)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/delivery.py        2014-05-20 18:50:48 UTC (rev 13517)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> from txweb2.stream import MemoryStream
</span><span class="cx"> 
</span><span class="cx"> from twisted.internet.defer import inlineCallbacks, DeferredList, returnValue
</span><ins>+from twisted.internet.error import ConnectionDone
</ins><span class="cx"> from twisted.internet.protocol import Factory
</span><span class="cx"> from twisted.python.failure import Failure
</span><span class="cx"> 
</span><span class="lines">@@ -116,10 +117,10 @@
</span><span class="cx">                             cls.domainServerMap[domain] = None
</span><span class="cx">                         else:
</span><span class="cx">                             # Create the iSchedule server record for this server
</span><del>-                            cls.domainServerMap[domain] = IScheduleServerRecord(uri=&quot;http://%s:%s/.well-known/ischedule&quot; % result)
</del><ins>+                            cls.domainServerMap[domain] = IScheduleServerRecord(uri=&quot;http://{}:{}/.well-known/ischedule&quot;.format(*result))
</ins><span class="cx">                     else:
</span><span class="cx">                         # Create the iSchedule server record for this server
</span><del>-                        cls.domainServerMap[domain] = IScheduleServerRecord(uri=&quot;https://%s:%s/.well-known/ischedule&quot; % result)
</del><ins>+                        cls.domainServerMap[domain] = IScheduleServerRecord(uri=&quot;https://{}:{}/.well-known/ischedule&quot;.format(*result))
</ins><span class="cx">             else:
</span><span class="cx">                 cls.domainServerMap[domain] = None
</span><span class="cx"> 
</span><span class="lines">@@ -260,11 +261,15 @@
</span><span class="cx">                 xml = (yield davXMLFromStream(response.stream))
</span><span class="cx">                 self._parseResponse(xml)
</span><span class="cx">             else:
</span><del>-                raise ValueError(&quot;Incorrect server response status code: %s&quot; % (response.code,))
</del><ins>+                raise ValueError(&quot;Incorrect server response status code: {code}&quot;.format(code=response.code))
</ins><span class="cx"> 
</span><span class="cx">         except Exception, e:
</span><span class="cx">             # Generated failed responses for each recipient
</span><del>-            log.error(&quot;Could not do server-to-server request : %s %s&quot; % (self, e))
</del><ins>+            log.error(
+                &quot;Could not do server-to-server request : {req} {exc}&quot;,
+                req=self,
+                exc=e,
+            )
</ins><span class="cx">             for recipient in self.recipients:
</span><span class="cx">                 err = HTTPError(ErrorResponse(
</span><span class="cx">                     responsecode.FORBIDDEN,
</span><span class="lines">@@ -283,17 +288,17 @@
</span><span class="cx">         iostr = StringIO()
</span><span class="cx">         iostr.write(&quot;&gt;&gt;&gt;&gt; Request start\n\n&quot;)
</span><span class="cx">         if hasattr(request, &quot;clientproto&quot;):
</span><del>-            protocol = &quot;HTTP/%d.%d&quot; % (request.clientproto[0], request.clientproto[1],)
</del><ins>+            protocol = &quot;HTTP/{:d}.{:d}&quot;.format(request.clientproto[0], request.clientproto[1])
</ins><span class="cx">         else:
</span><span class="cx">             protocol = &quot;HTTP/1.1&quot;
</span><del>-        iostr.write(&quot;%s %s %s\n&quot; % (request.method, request.uri, protocol,))
</del><ins>+        iostr.write(&quot;{} {} {}\n&quot;.format(request.method, request.uri, protocol,))
</ins><span class="cx">         for name, valuelist in request.headers.getAllRawHeaders():
</span><span class="cx">             for value in valuelist:
</span><span class="cx">                 # Do not log authorization details
</span><span class="cx">                 if name not in (&quot;Authorization&quot;,):
</span><del>-                    iostr.write(&quot;%s: %s\n&quot; % (name, value))
</del><ins>+                    iostr.write(&quot;{}: {}\n&quot;.format(name, value))
</ins><span class="cx">                 else:
</span><del>-                    iostr.write(&quot;%s: xxxxxxxxx\n&quot; % (name,))
</del><ins>+                    iostr.write(&quot;{}: xxxxxxxxx\n&quot;.format(name,))
</ins><span class="cx">         iostr.write(&quot;\n&quot;)
</span><span class="cx"> 
</span><span class="cx">         # We need to play a trick with the request stream as we can only read it once. So we
</span><span class="lines">@@ -316,20 +321,23 @@
</span><span class="cx">         iostr = StringIO()
</span><span class="cx">         iostr.write(&quot;&gt;&gt;&gt;&gt; Response start\n\n&quot;)
</span><span class="cx">         code_message = responsecode.RESPONSES.get(response.code, &quot;Unknown Status&quot;)
</span><del>-        iostr.write(&quot;HTTP/1.1 %s %s\n&quot; % (response.code, code_message,))
</del><ins>+        iostr.write(&quot;HTTP/1.1 {} {}\n&quot;.format(response.code, code_message,))
</ins><span class="cx">         for name, valuelist in response.headers.getAllRawHeaders():
</span><span class="cx">             for value in valuelist:
</span><span class="cx">                 # Do not log authorization details
</span><span class="cx">                 if name not in (&quot;WWW-Authenticate&quot;,):
</span><del>-                    iostr.write(&quot;%s: %s\n&quot; % (name, value))
</del><ins>+                    iostr.write(&quot;{}: {}\n&quot;.format(name, value))
</ins><span class="cx">                 else:
</span><del>-                    iostr.write(&quot;%s: xxxxxxxxx\n&quot; % (name,))
</del><ins>+                    iostr.write(&quot;{}: xxxxxxxxx\n&quot;.format(name,))
</ins><span class="cx">         iostr.write(&quot;\n&quot;)
</span><span class="cx"> 
</span><span class="cx">         # We need to play a trick with the response stream to ensure we don't mess it up. So we
</span><span class="cx">         # read it, store the value in a MemoryStream, and replace the response's stream with that,
</span><span class="cx">         # so the data can be read again.
</span><del>-        data = (yield allDataFromStream(response.stream))
</del><ins>+        try:
+            data = (yield allDataFromStream(response.stream))
+        except ConnectionDone:
+            data = &quot;&quot;
</ins><span class="cx">         iostr.write(data)
</span><span class="cx">         response.stream = MemoryStream(data if data is not None else &quot;&quot;)
</span><span class="cx">         response.stream.doStartReading = None
</span><span class="lines">@@ -358,7 +366,7 @@
</span><span class="cx">         self.sign_headers = []
</span><span class="cx"> 
</span><span class="cx">         self.headers = Headers()
</span><del>-        self.headers.setHeader(&quot;Host&quot;, utf8String(host + &quot;:%s&quot; % (port,)))
</del><ins>+        self.headers.setHeader(&quot;Host&quot;, utf8String(host + &quot;:{}&quot;.format(port,)))
</ins><span class="cx"> 
</span><span class="cx">         # The Originator must be the ORGANIZER (for a request) or ATTENDEE (for a reply)
</span><span class="cx">         originator = self.scheduler.organizer.cuaddr if self.scheduler.isiTIPRequest else self.scheduler.attendee
</span><span class="lines">@@ -385,7 +393,7 @@
</span><span class="cx">         ))
</span><span class="cx">         self.sign_headers.append(&quot;Content-Type&quot;)
</span><span class="cx"> 
</span><del>-        self.headers.setHeader(&quot;User-Agent&quot;, &quot;CalendarServer/%s&quot; % (version,))
</del><ins>+        self.headers.setHeader(&quot;User-Agent&quot;, &quot;CalendarServer/{}&quot;.format(version,))
</ins><span class="cx">         self.sign_headers.append(&quot;User-Agent&quot;)
</span><span class="cx"> 
</span><span class="cx">         # Add any additional headers
</span><span class="lines">@@ -400,7 +408,7 @@
</span><span class="cx">         if self.server.authentication and self.server.authentication[0] == &quot;basic&quot;:
</span><span class="cx">             self.headers.setHeader(
</span><span class="cx">                 &quot;Authorization&quot;,
</span><del>-                ('Basic', (&quot;%s:%s&quot; % (self.server.authentication[1], self.server.authentication[2],)).encode('base64')[:-1])
</del><ins>+                ('Basic', (&quot;{}:{}&quot;.format(self.server.authentication[1], self.server.authentication[2],)).encode('base64')[:-1])
</ins><span class="cx">             )
</span><span class="cx">             self.sign_headers.append(&quot;Authorization&quot;)
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServertrunktxdavcaldavdatastoreschedulingischeduledkimpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/dkim.py (13516 => 13517)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/dkim.py        2014-05-20 18:49:22 UTC (rev 13516)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/dkim.py        2014-05-20 18:50:48 UTC (rev 13517)
</span><span class="lines">@@ -862,7 +862,7 @@
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx">         # First we do an SRV lookup for _domainkey to get the public key server host/port
</span><del>-        result = (yield lookupServerViaSRV(self.dkim_tags[&quot;d&quot;], service=&quot;_domainkey&quot;))
</del><ins>+        result = (yield lookupServerViaSRV(self.dkim_tags[&quot;d&quot;], service=&quot;_domainkey_lookup&quot;))
</ins><span class="cx">         if result is None:
</span><span class="cx">             log.debug(&quot;DKIM: SRV _domainkey failed on: %s trying domain directly&quot; % (self.dkim_tags[&quot;d&quot;],))
</span><span class="cx">             host = self.dkim_tags[&quot;d&quot;]
</span></span></pre></div>
<a id="CalendarServertrunktxdavcaldavdatastoreschedulingischedulelocalserverspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/localservers.py (13516 => 13517)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/localservers.py        2014-05-20 18:49:22 UTC (rev 13516)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/localservers.py        2014-05-20 18:50:48 UTC (rev 13517)
</span><span class="lines">@@ -75,7 +75,7 @@
</span><span class="cx">                 self._thisServer = server
</span><span class="cx">                 break
</span><span class="cx">         else:
</span><del>-            raise ValueError(&quot;No server in %s matches this server.&quot; % (self._xmlFile,))
</del><ins>+            raise ValueError(&quot;No server in {} matches this server.&quot;.format(self._xmlFile,))
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     def clear(self):
</span><span class="lines">@@ -168,7 +168,7 @@
</span><span class="cx">         try:
</span><span class="cx">             ips = getIPsFromHost(parsed_uri.hostname)
</span><span class="cx">         except socket.gaierror, e:
</span><del>-            msg = &quot;Unable to lookup ip-addr for server '%s': %s&quot; % (parsed_uri.hostname, str(e))
</del><ins>+            msg = &quot;Unable to lookup ip-addr for server '{}': {}&quot;.format(parsed_uri.hostname, str(e))
</ins><span class="cx">             log.error(msg)
</span><span class="cx">             if ignoreIPLookupFailures:
</span><span class="cx">                 ips = ()
</span><span class="lines">@@ -182,7 +182,7 @@
</span><span class="cx">                 try:
</span><span class="cx">                     ips = getIPsFromHost(item)
</span><span class="cx">                 except socket.gaierror, e:
</span><del>-                    msg = &quot;Unable to lookup ip-addr for allowed-from '%s': %s&quot; % (item, str(e))
</del><ins>+                    msg = &quot;Unable to lookup ip-addr for allowed-from '{}': {}&quot;.format(item, str(e))
</ins><span class="cx">                     log.error(msg)
</span><span class="cx">                     if not ignoreIPLookupFailures:
</span><span class="cx">                         raise ValueError(msg)
</span><span class="lines">@@ -214,13 +214,22 @@
</span><span class="cx">         request_secret = headers.getRawHeaders(SERVER_SECRET_HEADER)
</span><span class="cx"> 
</span><span class="cx">         if request_secret is not None and self.shared_secret is None:
</span><del>-            log.error(&quot;iSchedule request included unexpected %s header&quot; % (SERVER_SECRET_HEADER,))
</del><ins>+            log.error(
+                &quot;iSchedule request included unexpected {hdr} header&quot;,
+                hdr=SERVER_SECRET_HEADER,
+            )
</ins><span class="cx">             return False
</span><span class="cx">         elif request_secret is None and self.shared_secret is not None:
</span><del>-            log.error(&quot;iSchedule request did not include required %s header&quot; % (SERVER_SECRET_HEADER,))
</del><ins>+            log.error(
+                &quot;iSchedule request did not include required {hdr} header&quot;,
+                hdr=SERVER_SECRET_HEADER,
+            )
</ins><span class="cx">             return False
</span><span class="cx">         elif (request_secret[0] if request_secret else None) != self.shared_secret:
</span><del>-            log.error(&quot;iSchedule request %s header did not match&quot; % (SERVER_SECRET_HEADER,))
</del><ins>+            log.error(
+                &quot;iSchedule request {hdr} header did not match&quot;,
+                hdr=SERVER_SECRET_HEADER,
+            )
</ins><span class="cx">             return False
</span><span class="cx">         else:
</span><span class="cx">             return True
</span><span class="lines">@@ -278,12 +287,12 @@
</span><span class="cx">         try:
</span><span class="cx">             _ignore_tree, servers_node = readXML(xmlFile, ELEMENT_SERVERS)
</span><span class="cx">         except ValueError, e:
</span><del>-            raise RuntimeError(&quot;XML parse error for '%s' because: %s&quot; % (xmlFile, e,))
</del><ins>+            raise RuntimeError(&quot;XML parse error for '{}' because: {}&quot;.format(xmlFile, e,))
</ins><span class="cx"> 
</span><span class="cx">         for child in servers_node:
</span><span class="cx"> 
</span><span class="cx">             if child.tag != ELEMENT_SERVER:
</span><del>-                raise RuntimeError(&quot;Unknown server type: '%s' in servers file: '%s'&quot; % (child.tag, xmlFile,))
</del><ins>+                raise RuntimeError(&quot;Unknown server type: '{}' in servers file: '{}'&quot;.format(child.tag, xmlFile,))
</ins><span class="cx"> 
</span><span class="cx">             server = Server()
</span><span class="cx">             server.isImplicit = child.get(ATTR_IMPLICIT, ATTR_VALUE_YES) == ATTR_VALUE_YES
</span><span class="lines">@@ -298,10 +307,10 @@
</span><span class="cx">                 elif node.tag == ELEMENT_SHARED_SECRET:
</span><span class="cx">                     server.shared_secret = node.text
</span><span class="cx">                 else:
</span><del>-                    raise RuntimeError(&quot;Invalid element '%s' in servers file: '%s'&quot; % (node.tag, xmlFile,))
</del><ins>+                    raise RuntimeError(&quot;Invalid element '{}' in servers file: '{}'&quot;.format(node.tag, xmlFile,))
</ins><span class="cx"> 
</span><span class="cx">             if server.id is None or server.uri is None:
</span><del>-                raise RuntimeError(&quot;Invalid server '%s' in servers file: '%s'&quot; % (child.tag, xmlFile,))
</del><ins>+                raise RuntimeError(&quot;Invalid server '{}' in servers file: '{}'&quot;.format(child.tag, xmlFile,))
</ins><span class="cx"> 
</span><span class="cx">             server.check(ignoreIPLookupFailures=ignoreIPLookupFailures)
</span><span class="cx">             results[server.id] = server
</span></span></pre></div>
<a id="CalendarServertrunktxdavcaldavdatastoreschedulingischeduleremoteserverspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/remoteservers.py (13516 => 13517)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/remoteservers.py        2014-05-20 18:49:22 UTC (rev 13516)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/remoteservers.py        2014-05-20 18:50:48 UTC (rev 13517)
</span><span class="lines">@@ -109,7 +109,7 @@
</span><span class="cx">     Server-to-server configuration file parser.
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="cx">     def __repr__(self):
</span><del>-        return &quot;&lt;%s %r&gt;&quot; % (self.__class__.__name__, self.xmlFile)
</del><ins>+        return &quot;&lt;{} {}&gt;&quot;.format(self.__class__.__name__, self.xmlFile)
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     def __init__(self, xmlFile):
</span><span class="lines">@@ -188,7 +188,7 @@
</span><span class="cx">             elif child.tag == ELEMENT_CLIENT_HOSTS:
</span><span class="cx">                 self._parseList(child, ELEMENT_HOST, self.client_hosts)
</span><span class="cx">             else:
</span><del>-                raise RuntimeError(&quot;[%s] Unknown attribute: %s&quot; % (self.__class__, child.tag,))
</del><ins>+                raise RuntimeError(&quot;[{}] Unknown attribute: {}&quot;.format(self.__class__, child.tag,))
</ins><span class="cx"> 
</span><span class="cx">         self._parseDetails()
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServertrunktxdavcaldavdatastoreschedulingischeduleresourcepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/resource.py (13516 => 13517)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/resource.py        2014-05-20 18:49:22 UTC (rev 13516)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/resource.py        2014-05-20 18:50:48 UTC (rev 13517)
</span><span class="lines">@@ -111,12 +111,12 @@
</span><span class="cx">     def render(self, request):
</span><span class="cx">         output = &quot;&quot;&quot;&lt;html&gt;
</span><span class="cx"> &lt;head&gt;
</span><del>-&lt;title&gt;%(rtype)s Inbox Resource&lt;/title&gt;
</del><ins>+&lt;title&gt;{rtype} Inbox Resource&lt;/title&gt;
</ins><span class="cx"> &lt;/head&gt;
</span><span class="cx"> &lt;body&gt;
</span><del>-&lt;h1&gt;%(rtype)s Inbox Resource.&lt;/h1&gt;
</del><ins>+&lt;h1&gt;{rtype} Inbox Resource.&lt;/h1&gt;
</ins><span class="cx"> &lt;/body
</span><del>-&lt;/html&gt;&quot;&quot;&quot; % {&quot;rtype&quot; : &quot;Podding&quot; if self._podding else &quot;iSchedule&quot;, }
</del><ins>+&lt;/html&gt;&quot;&quot;&quot;.format(rtype=&quot;Podding&quot; if self._podding else &quot;iSchedule&quot;)
</ins><span class="cx"> 
</span><span class="cx">         response = Response(200, {}, output)
</span><span class="cx">         response.headers.setHeader(&quot;content-type&quot;, MimeType(&quot;text&quot;, &quot;html&quot;))
</span><span class="lines">@@ -238,7 +238,7 @@
</span><span class="cx">         format = self.determineType(contentType)
</span><span class="cx"> 
</span><span class="cx">         if format is None:
</span><del>-            msg = &quot;MIME type %s not allowed in iSchedule request&quot; % (contentType,)
</del><ins>+            msg = &quot;MIME type {} not allowed in iSchedule request&quot;.format(contentType,)
</ins><span class="cx">             self.log.error(msg)
</span><span class="cx">             raise HTTPError(scheduler.errorResponse(
</span><span class="cx">                 responsecode.FORBIDDEN,
</span><span class="lines">@@ -272,7 +272,7 @@
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         format = None
</span><span class="cx">         if content_type is not None:
</span><del>-            format = &quot;%s/%s&quot; % (content_type.mediaType, content_type.mediaSubtype,)
</del><ins>+            format = &quot;{}/{}&quot;.format(content_type.mediaType, content_type.mediaSubtype,)
</ins><span class="cx">         return format if format in Component.allowedTypes() else None
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -295,7 +295,10 @@
</span><span class="cx">         # Get list of Recipient headers
</span><span class="cx">         rawRecipients = request.headers.getRawHeaders(&quot;recipient&quot;)
</span><span class="cx">         if rawRecipients is None or (len(rawRecipients) == 0):
</span><del>-            self.log.error(&quot;%s request must have at least one Recipient header&quot; % (self.method,))
</del><ins>+            self.log.error(
+                &quot;{method} request must have at least one Recipient header&quot;,
+                method=self.method,
+            )
</ins><span class="cx">             raise HTTPError(ErrorResponse(
</span><span class="cx">                 responsecode.FORBIDDEN,
</span><span class="cx">                 (ischedule_namespace, &quot;recipient-missing&quot;),
</span><span class="lines">@@ -318,7 +321,10 @@
</span><span class="cx">         # Must be content-type text/calendar
</span><span class="cx">         contentType = request.headers.getHeader(&quot;content-type&quot;)
</span><span class="cx">         if contentType is not None and (contentType.mediaType, contentType.mediaSubtype) != (&quot;text&quot;, &quot;calendar&quot;):
</span><del>-            self.log.error(&quot;MIME type %s not allowed in iSchedule POST request&quot; % (contentType,))
</del><ins>+            self.log.error(
+                &quot;MIME type {ct} not allowed in iSchedule POST request&quot;,
+                ct=contentType,
+            )
</ins><span class="cx">             raise HTTPError(ErrorResponse(
</span><span class="cx">                 responsecode.FORBIDDEN,
</span><span class="cx">                 (ischedule_namespace, &quot;invalid-calendar-data-type&quot;),
</span><span class="lines">@@ -330,7 +336,10 @@
</span><span class="cx">             calendar = (yield Component.fromIStream(request.stream))
</span><span class="cx">         except:
</span><span class="cx">             # FIXME: Bare except
</span><del>-            self.log.error(&quot;Error while handling iSchedule POST: %s&quot; % (Failure(),))
</del><ins>+            self.log.error(
+                &quot;Error while handling iSchedule POST: {f}&quot;,
+                f=Failure(),
+            )
</ins><span class="cx">             raise HTTPError(ErrorResponse(
</span><span class="cx">                 responsecode.FORBIDDEN,
</span><span class="cx">                 (ischedule_namespace, &quot;invalid-calendar-data&quot;),
</span></span></pre></div>
<a id="CalendarServertrunktxdavcaldavdatastoreschedulingischeduleschedulerpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/scheduler.py (13516 => 13517)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/scheduler.py        2014-05-20 18:49:22 UTC (rev 13516)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/scheduler.py        2014-05-20 18:50:48 UTC (rev 13517)
</span><span class="lines">@@ -97,7 +97,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     def __repr__(self):
</span><del>-        return &quot;&lt;%s %s %s&gt;&quot; % (self.__class__.__name__, self.code, self.error.sname())
</del><ins>+        return &quot;&lt;{} {} {}&gt;&quot;.format(self.__class__.__name__, self.code, self.error.sname())
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -171,9 +171,9 @@
</span><span class="cx">                 # If DKIM is enabled and there was a DKIM header present, then fail
</span><span class="cx">                 msg = &quot;Failed to verify DKIM signature&quot;
</span><span class="cx">                 _debug_msg = str(e)
</span><del>-                log.debug(&quot;%s:%s&quot; % (msg, _debug_msg,))
</del><ins>+                log.debug(&quot;{msg}:{exc}&quot;, msg=msg, exc=_debug_msg,)
</ins><span class="cx">                 if config.Scheduling.iSchedule.DKIM.ProtocolDebug:
</span><del>-                    msg = &quot;%s:%s&quot; % (msg, _debug_msg,)
</del><ins>+                    msg = &quot;{}:{}&quot;.format(msg, _debug_msg,)
</ins><span class="cx">                 raise HTTPError(self.errorResponse(
</span><span class="cx">                     responsecode.FORBIDDEN,
</span><span class="cx">                     (ischedule_namespace, &quot;verification-failed&quot;),
</span><span class="lines">@@ -211,7 +211,10 @@
</span><span class="cx">     def checkAuthorization(self):
</span><span class="cx">         # Must have an unauthenticated user
</span><span class="cx">         if self.originator_uid is not None:
</span><del>-            log.error(&quot;Authenticated originators not allowed: %s&quot; % (self.originator_uid,))
</del><ins>+            log.error(
+                &quot;Authenticated originators not allowed: {o}&quot;,
+                o=self.originator_uid,
+            )
</ins><span class="cx">             raise HTTPError(self.errorResponse(
</span><span class="cx">                 responsecode.FORBIDDEN,
</span><span class="cx">                 self.errorElements[&quot;originator-denied&quot;],
</span><span class="lines">@@ -233,7 +236,10 @@
</span><span class="cx"> 
</span><span class="cx">             # iSchedule must never deliver for users hosted on the server or any pod
</span><span class="cx">             if not self._podding:
</span><del>-                log.error(&quot;Cannot use originator that is local to this server: %s&quot; % (self.originator,))
</del><ins>+                log.error(
+                    &quot;Cannot use originator that is local to this server: {o}&quot;,
+                    o=self.originator,
+                )
</ins><span class="cx">                 raise HTTPError(self.errorResponse(
</span><span class="cx">                     responsecode.FORBIDDEN,
</span><span class="cx">                     self.errorElements[&quot;originator-denied&quot;],
</span><span class="lines">@@ -242,7 +248,10 @@
</span><span class="cx"> 
</span><span class="cx">             # Cannot deliver message for someone hosted on the same pod
</span><span class="cx">             elif isinstance(originatorAddress, LocalCalendarUser):
</span><del>-                log.error(&quot;Cannot use originator that is on this server: %s&quot; % (self.originator,))
</del><ins>+                log.error(
+                    &quot;Cannot use originator that is on this server: {o}&quot;,
+                    o=self.originator,
+                )
</ins><span class="cx">                 raise HTTPError(self.errorResponse(
</span><span class="cx">                     responsecode.FORBIDDEN,
</span><span class="cx">                     self.errorElements[&quot;originator-denied&quot;],
</span><span class="lines">@@ -253,7 +262,10 @@
</span><span class="cx">                 self._validAlternateServer(originatorAddress)
</span><span class="cx">         else:
</span><span class="cx">             if self._podding:
</span><del>-                log.error(&quot;Cannot use originator that is external to this server: %s&quot; % (self.originator,))
</del><ins>+                log.error(
+                    &quot;Cannot use originator that is external to this server: {o}&quot;,
+                    o=self.originator,
+                )
</ins><span class="cx">                 raise HTTPError(self.errorResponse(
</span><span class="cx">                     responsecode.FORBIDDEN,
</span><span class="cx">                     self.errorElements[&quot;originator-denied&quot;],
</span><span class="lines">@@ -277,7 +289,10 @@
</span><span class="cx">         servermgr = IScheduleServers()
</span><span class="cx">         server = servermgr.mapDomain(self.originator.domain)
</span><span class="cx">         if not server or not server.allow_from:
</span><del>-            log.error(&quot;Originator not on recognized server: %s&quot; % (self.originator,))
</del><ins>+            log.error(
+                &quot;Originator not on recognized server: {o}&quot;,
+                o=self.originator,
+            )
</ins><span class="cx">             raise HTTPError(self.errorResponse(
</span><span class="cx">                 responsecode.FORBIDDEN,
</span><span class="cx">                 self.errorElements[&quot;originator-denied&quot;],
</span><span class="lines">@@ -309,15 +324,26 @@
</span><span class="cx">                                     matched = True
</span><span class="cx">                                     break
</span><span class="cx">                             except re.error:
</span><del>-                                log.debug(&quot;Invalid regular expression for ServerToServer white list for server domain %s: %s&quot; % (self.originator.domain, pattern,))
</del><ins>+                                log.debug(
+                                    &quot;Invalid regular expression for ServerToServer white list for server domain {domain}: {pat}&quot;,
+                                    dom=self.originator.domain,
+                                    pat=pattern,
+                                )
</ins><span class="cx">                         else:
</span><span class="cx">                             continue
</span><span class="cx">                         break
</span><span class="cx">                 except socket.herror, e:
</span><del>-                    log.debug(&quot;iSchedule cannot lookup client ip '%s': %s&quot; % (clientip, str(e),))
</del><ins>+                    log.debug(
+                        &quot;iSchedule cannot lookup client ip '{ip}': {exc}&quot;,
+                        ip=clientip,
+                        exc=str(e),
+                    )
</ins><span class="cx"> 
</span><span class="cx">             if not matched:
</span><del>-                log.error(&quot;Originator not on allowed server: %s&quot; % (self.originator,))
</del><ins>+                log.error(
+                    &quot;Originator not on allowed server: {o}&quot;,
+                    o=self.originator,
+                )
</ins><span class="cx">                 raise HTTPError(self.errorResponse(
</span><span class="cx">                     responsecode.FORBIDDEN,
</span><span class="cx">                     self.errorElements[&quot;originator-denied&quot;],
</span><span class="lines">@@ -348,7 +374,10 @@
</span><span class="cx">         elif serversDB.getThisServer().hasAllowedFromIP():
</span><span class="cx">             matched = serversDB.getThisServer().checkAllowedFromIP(clientip)
</span><span class="cx">             if not matched:
</span><del>-                log.error(&quot;Invalid iSchedule connection from client: %s&quot; % (clientip,))
</del><ins>+                log.error(
+                    &quot;Invalid iSchedule connection from client: {o}&quot;,
+                    o=clientip,
+                )
</ins><span class="cx"> 
</span><span class="cx">         # Next compare as dotted IP
</span><span class="cx">         elif isIPAddress(expected_uri.hostname):
</span><span class="lines">@@ -363,7 +392,11 @@
</span><span class="cx">                         matched = True
</span><span class="cx">                         break
</span><span class="cx">             except socket.herror, e:
</span><del>-                log.debug(&quot;iSchedule cannot lookup client ip '%s': %s&quot; % (clientip, str(e),))
</del><ins>+                log.debug(
+                    &quot;iSchedule cannot lookup client ip '{ip}': {exc}&quot;,
+                    ip=clientip,
+                    exc=str(e),
+                )
</ins><span class="cx"> 
</span><span class="cx">         # Check possible shared secret
</span><span class="cx">         if matched and not serversDB.getThisServer().checkSharedSecret(self.headers):
</span><span class="lines">@@ -371,7 +404,10 @@
</span><span class="cx">             matched = False
</span><span class="cx"> 
</span><span class="cx">         if not matched:
</span><del>-            log.error(&quot;Originator not on allowed server: %s&quot; % (self.originator,))
</del><ins>+            log.error(
+                &quot;Originator not on allowed server: {o}&quot;,
+                o=self.originator,
+            )
</ins><span class="cx">             raise HTTPError(self.errorResponse(
</span><span class="cx">                 responsecode.FORBIDDEN,
</span><span class="cx">                 self.errorElements[&quot;originator-denied&quot;],
</span><span class="lines">@@ -391,7 +427,10 @@
</span><span class="cx">             organizerAddress = yield calendarUserFromCalendarUserAddress(organizer, self.txn)
</span><span class="cx">             if organizerAddress.hosted():
</span><span class="cx">                 if isinstance(organizerAddress, LocalCalendarUser):
</span><del>-                    log.error(&quot;Invalid ORGANIZER in calendar data: %s&quot; % (self.calendar,))
</del><ins>+                    log.error(
+                        &quot;Invalid ORGANIZER in calendar data: {cal}&quot;,
+                        cal=self.calendar,
+                    )
</ins><span class="cx">                     raise HTTPError(self.errorResponse(
</span><span class="cx">                         responsecode.FORBIDDEN,
</span><span class="cx">                         self.errorElements[&quot;organizer-denied&quot;],
</span><span class="lines">@@ -404,7 +443,10 @@
</span><span class="cx">             else:
</span><span class="cx">                 localUser = (yield addressmapping.mapper.isCalendarUserInMyDomain(organizer))
</span><span class="cx">                 if localUser:
</span><del>-                    log.error(&quot;Unsupported ORGANIZER in calendar data: %s&quot; % (self.calendar,))
</del><ins>+                    log.error(
+                        &quot;Unsupported ORGANIZER in calendar data: {cal}&quot;,
+                        cal=self.calendar,
+                    )
</ins><span class="cx">                     raise HTTPError(self.errorResponse(
</span><span class="cx">                         responsecode.FORBIDDEN,
</span><span class="cx">                         self.errorElements[&quot;organizer-denied&quot;],
</span><span class="lines">@@ -413,7 +455,10 @@
</span><span class="cx">                 else:
</span><span class="cx">                     self.organizer = RemoteCalendarUser(organizer)
</span><span class="cx">         else:
</span><del>-            log.error(&quot;ORGANIZER missing in calendar data: %s&quot; % (self.calendar,))
</del><ins>+            log.error(
+                &quot;ORGANIZER missing in calendar data: {cal}&quot;,
+                cal=self.calendar,
+            )
</ins><span class="cx">             raise HTTPError(self.errorResponse(
</span><span class="cx">                 responsecode.FORBIDDEN,
</span><span class="cx">                 self.errorElements[&quot;organizer-denied&quot;],
</span><span class="lines">@@ -432,7 +477,10 @@
</span><span class="cx">         attendeeAddress = yield calendarUserFromCalendarUserAddress(self.attendee, self.txn)
</span><span class="cx">         if attendeeAddress.hosted():
</span><span class="cx">             if isinstance(attendeeAddress, LocalCalendarUser):
</span><del>-                log.error(&quot;Invalid ATTENDEE in calendar data: %s&quot; % (self.calendar,))
</del><ins>+                log.error(
+                    &quot;Invalid ATTENDEE in calendar data: {cal}&quot;,
+                    cal=self.calendar,
+                )
</ins><span class="cx">                 raise HTTPError(self.errorResponse(
</span><span class="cx">                     responsecode.FORBIDDEN,
</span><span class="cx">                     self.errorElements[&quot;attendee-denied&quot;],
</span><span class="lines">@@ -443,7 +491,10 @@
</span><span class="cx">         else:
</span><span class="cx">             localUser = (yield addressmapping.mapper.isCalendarUserInMyDomain(self.attendee))
</span><span class="cx">             if localUser:
</span><del>-                log.error(&quot;Unknown ATTENDEE in calendar data: %s&quot; % (self.calendar,))
</del><ins>+                log.error(
+                    &quot;Unknown ATTENDEE in calendar data: {cal}&quot;,
+                    cal=self.calendar,
+                )
</ins><span class="cx">                 raise HTTPError(self.errorResponse(
</span><span class="cx">                     responsecode.FORBIDDEN,
</span><span class="cx">                     self.errorElements[&quot;attendee-denied&quot;],
</span><span class="lines">@@ -468,7 +519,10 @@
</span><span class="cx">             yield self.checkAttendeeAsOriginator()
</span><span class="cx"> 
</span><span class="cx">         else:
</span><del>-            log.error(&quot;Unknown iTIP METHOD for security checks: %s&quot; % (self.calendar.propertyValue(&quot;METHOD&quot;),))
</del><ins>+            log.error(
+                &quot;Unknown iTIP METHOD for security checks: {method}&quot;,
+                method=self.calendar.propertyValue(&quot;METHOD&quot;),
+            )
</ins><span class="cx">             raise HTTPError(self.errorResponse(
</span><span class="cx">                 responsecode.FORBIDDEN,
</span><span class="cx">                 self.errorElements[&quot;invalid-scheduling-message&quot;],
</span></span></pre></div>
<a id="CalendarServertrunktxdavcaldavdatastoreschedulingischeduletestdatadbexamplecom"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/test/data/db.example.com (13516 => 13517)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/test/data/db.example.com        2014-05-20 18:49:22 UTC (rev 13516)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/test/data/db.example.com        2014-05-20 18:50:48 UTC (rev 13517)
</span><span class="lines">@@ -15,5 +15,5 @@
</span><span class="cx"> _ischedule._domainkey.example.com.        10800 IN TXT        &quot;v=DKIM1; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDjUfDqd8ICAL0dyq2KdjKN6LS8O/Y4yMxOxgATqtSIMi7baKXEs1w5Wj9efOC2nU+aqyhP2/J6AzfFJfSB+GV5gcIT+LAC4btJKPGjPUyXcQFJV4a73y0jIgCTBzWxdaP6qD9P9rzYlvMPcdrrKiKoAOtI3JZqAAdZudOmGlc4QQIDAQAB&quot;
</span><span class="cx"> _revoked._domainkey.example.com.        10800 IN TXT        &quot;v=DKIM1; p=&quot;
</span><span class="cx"> 
</span><del>-_domainkey._tcp.example.com.                10800 IN SRV        0        0        8443        key.example.com.
-_domainkey._tcp.www.example.com.        10800 IN SRV        0        0        80                key.example.com.
</del><ins>+_domainkey_lookup._tcp.example.com.                10800 IN SRV        0        0        8443        key.example.com.
+_domainkey_lookup._tcp.www.example.com.        10800 IN SRV        0        0        80                key.example.com.
</ins></span></pre></div>
<a id="CalendarServertrunktxdavcaldavdatastoreschedulingischeduleutilspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/utils.py (13516 => 13517)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/utils.py        2014-05-20 18:49:22 UTC (rev 13516)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/utils.py        2014-05-20 18:50:48 UTC (rev 13517)
</span><span class="lines">@@ -58,19 +58,19 @@
</span><span class="cx"> 
</span><span class="cx">     _initResolver()
</span><span class="cx"> 
</span><del>-    lookup = &quot;%s._tcp.%s&quot; % (service, domain,)
-    log.debug(&quot;DNS SRV: lookup: %s&quot; % (lookup,))
</del><ins>+    lookup = &quot;{}._tcp.{}&quot;.format(service, domain,)
+    log.debug(&quot;DNS SRV: lookup: {l}&quot;, l=lookup)
</ins><span class="cx">     try:
</span><span class="cx">         answers = (yield DebugResolver.lookupService(lookup))[0]
</span><span class="cx">     except (DomainError, AuthoritativeDomainError), e:
</span><del>-        log.debug(&quot;DNS SRV: lookup failed: %s&quot; % (e,))
</del><ins>+        log.debug(&quot;DNS SRV: lookup failed: {exc}&quot;, exc=e)
</ins><span class="cx">         returnValue(None)
</span><span class="cx"> 
</span><span class="cx">     if len(answers) == 1 and answers[0].type == dns.SRV \
</span><span class="cx">                          and answers[0].payload \
</span><span class="cx">                          and answers[0].payload.target == dns.Name('.'):
</span><span class="cx">         # decidedly not available
</span><del>-        log.debug(&quot;DNS SRV: disabled: %s&quot; % (lookup,))
</del><ins>+        log.debug(&quot;DNS SRV: disabled: {l}&quot;, l=lookup)
</ins><span class="cx">         returnValue(None)
</span><span class="cx"> 
</span><span class="cx">     servers = []
</span><span class="lines">@@ -81,7 +81,7 @@
</span><span class="cx"> 
</span><span class="cx">         servers.append((a.payload.priority, a.payload.weight, str(a.payload.target), a.payload.port))
</span><span class="cx"> 
</span><del>-    log.debug(&quot;DNS SRV: lookup results: %s\n%s&quot; % (lookup, servers,))
</del><ins>+    log.debug(&quot;DNS SRV: lookup results: {l}\n{s}&quot;, l=lookup, s=servers)
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     def _serverCmp(a, b):
</span><span class="lines">@@ -104,10 +104,10 @@
</span><span class="cx">             host = host.rstrip(&quot;.&quot;)
</span><span class="cx">             break
</span><span class="cx">     else:
</span><del>-        log.debug(&quot;DNS SRV: unable to determine best record to use: %s&quot; % (lookup,))
</del><ins>+        log.debug(&quot;DNS SRV: unable to determine best record to use: {l}&quot;, l=lookup)
</ins><span class="cx">         returnValue(None)
</span><span class="cx"> 
</span><del>-    log.debug(&quot;DNS SRV: lookup chosen service: %s %s %s&quot; % (lookup, host, port,))
</del><ins>+    log.debug(&quot;DNS SRV: lookup chosen service: {l} {h} {p}&quot;, l=lookup, h=host, p=port)
</ins><span class="cx">     returnValue((host, port,))
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -117,12 +117,12 @@
</span><span class="cx"> 
</span><span class="cx">     _initResolver()
</span><span class="cx"> 
</span><del>-    lookup = &quot;%s.%s&quot; % (prefix, domain,) if prefix else domain
-    log.debug(&quot;DNS TXT: lookup: %s&quot; % (lookup,))
</del><ins>+    lookup = &quot;{}.{}&quot;.format(prefix, domain,) if prefix else domain
+    log.debug(&quot;DNS TXT: lookup: {l}&quot;, l=lookup)
</ins><span class="cx">     try:
</span><span class="cx">         answers = (yield DebugResolver.lookupText(lookup))[0]
</span><span class="cx">     except (DomainError, AuthoritativeDomainError), e:
</span><del>-        log.debug(&quot;DNS TXT: lookup failed: %s&quot; % (e,))
</del><ins>+        log.debug(&quot;DNS TXT: lookup failed: {exc}&quot;, exc=e)
</ins><span class="cx">         answers = ()
</span><span class="cx"> 
</span><span class="cx">     results = []
</span><span class="lines">@@ -133,7 +133,7 @@
</span><span class="cx"> 
</span><span class="cx">         results.append(&quot;&quot;.join(a.payload.data))
</span><span class="cx"> 
</span><del>-    log.debug(&quot;DNS TXT: lookup results: %s\n%s&quot; % (lookup, &quot;\n&quot;.join(results),))
</del><ins>+    log.debug(&quot;DNS TXT: lookup results: {l}\n{r}&quot;, l=lookup, r=&quot;\n&quot;.join(results))
</ins><span class="cx">     returnValue(results)
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -142,9 +142,20 @@
</span><span class="cx"> 
</span><span class="cx">     @inlineCallbacks
</span><span class="cx">     def _lookup(self, name, cls, type, timeout=None):
</span><del>-        log.debug(&quot;DNS FakeBindAuthority: lookup: %s %s %s&quot; % (name, cls, type,))
</del><ins>+        log.debug(
+            &quot;DNS FakeBindAuthority: lookup: {name} {cls} {type}&quot;,
+            name=name,
+            cls=cls,
+            type=type,
+        )
</ins><span class="cx">         result = yield BindAuthority._lookup(self, name, cls, type, timeout)
</span><del>-        log.debug(&quot;DNS FakeBindAuthority: lookup results: %s %s %s\n%s&quot; % (name, cls, type, result[0]))
</del><ins>+        log.debug(
+            &quot;DNS FakeBindAuthority: lookup results: {name} {cls} {type}\n{r}&quot;,
+            name=name,
+            cls=cls,
+            type=type,
+            r=result[0],
+        )
</ins><span class="cx">         returnValue(result)
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServertrunktxdavcaldavdatastoreschedulingischedulexmlpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/xml.py (13516 => 13517)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/xml.py        2014-05-20 18:49:22 UTC (rev 13516)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/ischedule/xml.py        2014-05-20 18:50:48 UTC (rev 13517)
</span><span class="lines">@@ -269,10 +269,10 @@
</span><span class="cx">                 raise ValueError(&quot;Missing calendar data&quot;)
</span><span class="cx">             return clazz(PCDATAElement(calendar))
</span><span class="cx">         elif isinstance(calendar, iComponent):
</span><del>-            assert calendar.name() == &quot;VCALENDAR&quot;, &quot;Not a calendar: %r&quot; % (calendar,)
</del><ins>+            assert calendar.name() == &quot;VCALENDAR&quot;, &quot;Not a calendar: {}&quot;.format(calendar)
</ins><span class="cx">             return clazz(PCDATAElement(calendar.getTextWithTimezones(includeTimezones=not config.EnableTimezonesByReference, format=format)))
</span><span class="cx">         else:
</span><del>-            raise ValueError(&quot;Not a calendar: %s&quot; % (calendar,))
</del><ins>+            raise ValueError(&quot;Not a calendar: {}&quot;.format(calendar))
</ins><span class="cx"> 
</span><span class="cx">     fromTextData = fromCalendar
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServertrunktxdavcaldavdatastoreschedulingschedulerpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/scheduler.py (13516 => 13517)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/scheduler.py        2014-05-20 18:49:22 UTC (rev 13516)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/scheduler.py        2014-05-20 18:50:48 UTC (rev 13517)
</span><span class="lines">@@ -172,7 +172,7 @@
</span><span class="cx">         # of data for all events with the same UID. So detect this and use a lock
</span><span class="cx">         if calendar.resourceType() != &quot;VFREEBUSY&quot;:
</span><span class="cx">             uid = calendar.resourceUID()
</span><del>-            yield NamedLock.acquire(self.txn, &quot;ImplicitUIDLock:%s&quot; % (hashlib.md5(uid).hexdigest(),))
</del><ins>+            yield NamedLock.acquire(self.txn, &quot;ImplicitUIDLock:{}&quot;.format(hashlib.md5(uid).hexdigest(),))
</ins><span class="cx"> 
</span><span class="cx">         result = (yield self.doSchedulingDirectly(&quot;POST&quot;, originator, recipients, calendar))
</span><span class="cx">         returnValue(result)
</span><span class="lines">@@ -276,7 +276,12 @@
</span><span class="cx">             try:
</span><span class="cx">                 self.calendar.validCalendarData()
</span><span class="cx">             except ValueError, e:
</span><del>-                log.error(&quot;%s request calendar component is not valid:%s %s&quot; % (self.method, e, self.calendar,))
</del><ins>+                log.error(
+                    &quot;{method} request calendar component is not valid:{exc} {cal}&quot;,
+                    method=self.method,
+                    exc=e,
+                    cal=self.calendar,
+                )
</ins><span class="cx">                 raise HTTPError(self.errorResponse(
</span><span class="cx">                     responsecode.FORBIDDEN,
</span><span class="cx">                     self.errorElements[&quot;invalid-calendar-data&quot;],
</span><span class="lines">@@ -285,7 +290,11 @@
</span><span class="cx"> 
</span><span class="cx">             # Must have a METHOD
</span><span class="cx">             if not self.calendar.isValidMethod():
</span><del>-                log.error(&quot;%s request must have valid METHOD property in calendar component: %s&quot; % (self.method, self.calendar,))
</del><ins>+                log.error(
+                    &quot;{method} request must have valid METHOD property in calendar component: {cal}&quot;,
+                    method=self.method,
+                    cal=self.calendar,
+                )
</ins><span class="cx">                 raise HTTPError(self.errorResponse(
</span><span class="cx">                     responsecode.FORBIDDEN,
</span><span class="cx">                     self.errorElements[&quot;invalid-scheduling-message&quot;],
</span><span class="lines">@@ -294,7 +303,11 @@
</span><span class="cx"> 
</span><span class="cx">             # Verify iTIP behavior
</span><span class="cx">             if not self.calendar.isValidITIP():
</span><del>-                log.error(&quot;%s request must have a calendar component that satisfies iTIP requirements: %s&quot; % (self.method, self.calendar,))
</del><ins>+                log.error(
+                    &quot;{method} request must have a calendar component that satisfies iTIP requirements: {cal}&quot;,
+                    method=self.method,
+                    cal=self.calendar,
+                )
</ins><span class="cx">                 raise HTTPError(self.errorResponse(
</span><span class="cx">                     responsecode.FORBIDDEN,
</span><span class="cx">                     self.errorElements[&quot;invalid-scheduling-message&quot;],
</span><span class="lines">@@ -303,7 +316,11 @@
</span><span class="cx"> 
</span><span class="cx">             # X-CALENDARSERVER-ACCESS is not allowed in Outbox POSTs
</span><span class="cx">             if self.calendar.hasProperty(Component.ACCESS_PROPERTY):
</span><del>-                log.error(&quot;X-CALENDARSERVER-ACCESS not allowed in a calendar component %s request: %s&quot; % (self.method, self.calendar,))
</del><ins>+                log.error(
+                    &quot;X-CALENDARSERVER-ACCESS not allowed in a calendar component {method} request: {cal}&quot;,
+                    method=self.method,
+                    cal=self.calendar,
+                )
</ins><span class="cx">                 raise HTTPError(self.errorResponse(
</span><span class="cx">                     responsecode.FORBIDDEN,
</span><span class="cx">                     (calendarserver_namespace, &quot;no-access-restrictions&quot;),
</span><span class="lines">@@ -322,7 +339,10 @@
</span><span class="cx"> 
</span><span class="cx">             # Must have only one
</span><span class="cx">             if len(attendees) != 1:
</span><del>-                log.error(&quot;Wrong number of ATTENDEEs in calendar data: %s&quot; % (str(self.calendar),))
</del><ins>+                log.error(
+                    &quot;Wrong number of ATTENDEEs in calendar data: {cal}&quot;,
+                    cal=str(self.calendar),
+                )
</ins><span class="cx">                 raise HTTPError(self.errorResponse(
</span><span class="cx">                     responsecode.FORBIDDEN,
</span><span class="cx">                     self.errorElements[&quot;invalid-scheduling-message&quot;],
</span><span class="lines">@@ -331,7 +351,7 @@
</span><span class="cx">             self.attendee = attendees[0]
</span><span class="cx"> 
</span><span class="cx">         else:
</span><del>-            msg = &quot;Unknown iTIP METHOD: %s&quot; % (self.calendar.propertyValue(&quot;METHOD&quot;),)
</del><ins>+            msg = &quot;Unknown iTIP METHOD: {}&quot;.format(self.calendar.propertyValue(&quot;METHOD&quot;),)
</ins><span class="cx">             log.error(msg)
</span><span class="cx">             raise HTTPError(self.errorResponse(
</span><span class="cx">                 responsecode.FORBIDDEN,
</span><span class="lines">@@ -346,7 +366,10 @@
</span><span class="cx">                 # Extract time range from VFREEBUSY object
</span><span class="cx">                 vfreebusies = [v for v in self.calendar.subcomponents() if v.name() == &quot;VFREEBUSY&quot;]
</span><span class="cx">                 if len(vfreebusies) != 1:
</span><del>-                    log.error(&quot;iTIP data is not valid for a VFREEBUSY request: %s&quot; % (self.calendar,))
</del><ins>+                    log.error(
+                        &quot;iTIP data is not valid for a VFREEBUSY request: {cal}&quot;,
+                        cal=str(self.calendar),
+                    )
</ins><span class="cx">                     raise HTTPError(self.errorResponse(
</span><span class="cx">                         responsecode.FORBIDDEN,
</span><span class="cx">                         self.errorElements[&quot;invalid-scheduling-message&quot;],
</span><span class="lines">@@ -355,7 +378,10 @@
</span><span class="cx">                 dtstart = vfreebusies[0].getStartDateUTC()
</span><span class="cx">                 dtend = vfreebusies[0].getEndDateUTC()
</span><span class="cx">                 if dtstart is None or dtend is None:
</span><del>-                    log.error(&quot;VFREEBUSY start/end not valid: %s&quot; % (self.calendar,))
</del><ins>+                    log.error(
+                        &quot;VFREEBUSY start/end not valid: {cal}&quot;,
+                        cal=str(self.calendar),
+                    )
</ins><span class="cx">                     raise HTTPError(self.errorResponse(
</span><span class="cx">                         responsecode.FORBIDDEN,
</span><span class="cx">                         self.errorElements[&quot;invalid-scheduling-message&quot;],
</span><span class="lines">@@ -364,7 +390,10 @@
</span><span class="cx"> 
</span><span class="cx">                 # Some clients send floating instead of UTC - coerce to UTC
</span><span class="cx">                 if not dtstart.utc() or not dtend.utc():
</span><del>-                    log.error(&quot;VFREEBUSY start or end not UTC: %s&quot; % (self.calendar,))
</del><ins>+                    log.error(
+                        &quot;VFREEBUSY start or end not UTC: {cal}&quot;,
+                        cal=self.calendar,
+                    )
</ins><span class="cx">                     raise HTTPError(self.errorResponse(
</span><span class="cx">                         responsecode.FORBIDDEN,
</span><span class="cx">                         self.errorElements[&quot;invalid-scheduling-message&quot;],
</span><span class="lines">@@ -406,12 +435,11 @@
</span><span class="cx">                 emitAccounting(
</span><span class="cx">                     accountingType,
</span><span class="cx">                     self.organizer.record,
</span><del>-                    &quot;Originator: %s\nRecipients:\n%sMethod:%s\n\n%s&quot;
-                    % (
-                        str(self.originator),
-                        str(&quot;&quot;.join([&quot;    %s\n&quot; % (recipient,) for recipient in self.recipients])),
-                        str(self.method),
-                        str(self.calendar),
</del><ins>+                    &quot;Originator: {o}\nRecipients:\n{r}Method:{method}\n\n{cal}&quot;.format(
+                        o=str(self.originator),
+                        r=str(&quot;&quot;.join([&quot;    {}\n&quot;.format(recipient,) for recipient in self.recipients])),
+                        method=str(self.method),
+                        cal=str(self.calendar),
</ins><span class="cx">                     )
</span><span class="cx">                 )
</span><span class="cx"> 
</span><span class="lines">@@ -426,7 +454,11 @@
</span><span class="cx">     @inlineCallbacks
</span><span class="cx">     def generateSchedulingResponse(self):
</span><span class="cx"> 
</span><del>-        log.info(&quot;METHOD: %s, Component: %s&quot; % (self.calendar.propertyValue(&quot;METHOD&quot;), self.calendar.mainType(),))
</del><ins>+        log.info(
+            &quot;METHOD: {method}, Component: {comp}&quot;,
+            method=self.calendar.propertyValue(&quot;METHOD&quot;),
+            comp=self.calendar.mainType(),
+        )
</ins><span class="cx"> 
</span><span class="cx">         # For free-busy do immediate determination of iTIP result rather than fan-out
</span><span class="cx">         freebusy = self.checkForFreeBusy()
</span><span class="lines">@@ -559,9 +591,15 @@
</span><span class="cx">             if not recipientAddress.hosted():
</span><span class="cx">                 localUser = (yield addressmapping.mapper.isCalendarUserInMyDomain(recipient))
</span><span class="cx">                 if localUser:
</span><del>-                    log.error(&quot;No record for calendar user address: %s&quot; % (recipient,))
</del><ins>+                    log.error(
+                        &quot;No record for calendar user address: {r}&quot;,
+                        r=recipient,
+                    )
</ins><span class="cx">                 else:
</span><del>-                    log.error(&quot;Unknown calendar user address: %s&quot; % (recipient,))
</del><ins>+                    log.error(
+                        &quot;Unknown calendar user address: {r}&quot;,
+                        r=recipient,
+                    )
</ins><span class="cx">                 results.append(InvalidCalendarUser(recipient))
</span><span class="cx">             else:
</span><span class="cx">                 # Map recipient to their inbox and cache on calendar user object
</span><span class="lines">@@ -578,7 +616,10 @@
</span><span class="cx">                 if inbox:
</span><span class="cx">                     results.append(recipientAddress)
</span><span class="cx">                 else:
</span><del>-                    log.error(&quot;No scheduling for calendar user: %s&quot; % (recipient,))
</del><ins>+                    log.error(
+                        &quot;No scheduling for calendar user: {r}&quot;,
+                        r=recipient,
+                    )
</ins><span class="cx">                     results.append(InvalidCalendarUser(recipient))
</span><span class="cx"> 
</span><span class="cx">         self.recipients = results
</span><span class="lines">@@ -704,13 +745,17 @@
</span><span class="cx">             error = self.errorForFailure(what)
</span><span class="cx">             message = messageForFailure(what)
</span><span class="cx">         else:
</span><del>-            raise AssertionError(&quot;Unknown data type: %r&quot; % (what,))
</del><ins>+            raise AssertionError(&quot;Unknown data type: {}&quot;.format(what,))
</ins><span class="cx"> 
</span><span class="cx">         if self.recipient_mapper is not None:
</span><span class="cx">             recipient = self.recipient_mapper(recipient)
</span><span class="cx"> 
</span><span class="cx">         if not suppressErrorLog and code &gt; 400: # Error codes only
</span><del>-            self.log.error(&quot;Error during %s for %s: %s&quot; % (self.method, recipient, message))
</del><ins>+            self.log.error(&quot;Error during {method} for {r}: {msg}&quot;,
+                method=self.method,
+                r=recipient,
+                msg=message,
+            )
</ins><span class="cx"> 
</span><span class="cx">         details = ScheduleResponseQueue.ScheduleResonseDetails(
</span><span class="cx">             self.recipient_element(davxml.HRef.fromString(recipient)) if self.recipient_uses_href else self.recipient_element.fromString(recipient),
</span></span></pre>
</div>
</div>

</body>
</html>