<!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>[15475] CalendarServer/trunk</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/15475">15475</a></dd>
<dt>Author</dt> <dd>sagen@apple.com</dd>
<dt>Date</dt> <dd>2016-03-16 14:42:01 -0700 (Wed, 16 Mar 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>AugmentService is ever present; if you don't want to use it just feed it an empty xmlFiles list.  Also, loginAllowed is mappable for LDAP</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServertrunkconfcaldavdappleplist">CalendarServer/trunk/conf/caldavd-apple.plist</a></li>
<li><a href="#CalendarServertrunkconfcaldavdstdconfigplist">CalendarServer/trunk/conf/caldavd-stdconfig.plist</a></li>
<li><a href="#CalendarServertrunkconfcaldavdtestplist">CalendarServer/trunk/conf/caldavd-test.plist</a></li>
<li><a href="#CalendarServertrunktwistedcaldavstdconfigpy">CalendarServer/trunk/twistedcaldav/stdconfig.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavtesttest_upgradepy">CalendarServer/trunk/twistedcaldav/test/test_upgrade.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavupgradepy">CalendarServer/trunk/twistedcaldav/upgrade.py</a></li>
<li><a href="#CalendarServertrunktxdavwhotesttest_utilpy">CalendarServer/trunk/txdav/who/test/test_util.py</a></li>
<li><a href="#CalendarServertrunktxdavwhoutilpy">CalendarServer/trunk/txdav/who/util.py</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServertrunkconfcaldavdappleplist"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/conf/caldavd-apple.plist (15474 => 15475)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/conf/caldavd-apple.plist        2016-03-14 19:41:46 UTC (rev 15474)
+++ CalendarServer/trunk/conf/caldavd-apple.plist        2016-03-16 21:42:01 UTC (rev 15475)
</span><span class="lines">@@ -230,6 +230,21 @@
</span><span class="cx">       &lt;/dict&gt;
</span><span class="cx">     &lt;/dict&gt;
</span><span class="cx"> 
</span><ins>+    &lt;!-- XML File Augment Service --&gt;
+    &lt;key&gt;AugmentService&lt;/key&gt;
+    &lt;dict&gt;
+      &lt;key&gt;type&lt;/key&gt;
+      &lt;string&gt;xml&lt;/string&gt;
+
+      &lt;key&gt;params&lt;/key&gt;
+      &lt;dict&gt;
+        &lt;key&gt;xmlFiles&lt;/key&gt;
+        &lt;array&gt;
+          &lt;string&gt;augments.xml&lt;/string&gt;
+        &lt;/array&gt;
+      &lt;/dict&gt;
+    &lt;/dict&gt;
+
</ins><span class="cx">     &lt;key&gt;DirectoryFilterStartsWith&lt;/key&gt;
</span><span class="cx">     &lt;true/&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServertrunkconfcaldavdstdconfigplist"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/conf/caldavd-stdconfig.plist (15474 => 15475)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/conf/caldavd-stdconfig.plist        2016-03-14 19:41:46 UTC (rev 15474)
+++ CalendarServer/trunk/conf/caldavd-stdconfig.plist        2016-03-16 21:42:01 UTC (rev 15475)
</span><span class="lines">@@ -405,9 +405,6 @@
</span><span class="cx"> 
</span><span class="cx">         &lt;key&gt;AugmentService&lt;/key&gt;
</span><span class="cx">         &lt;dict&gt;
</span><del>-                &lt;key&gt;Enabled&lt;/key&gt;
-                &lt;true/&gt;
-
</del><span class="cx">                 &lt;key&gt;type&lt;/key&gt;
</span><span class="cx">                 &lt;string&gt;xml&lt;/string&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -415,7 +412,6 @@
</span><span class="cx">                 &lt;dict&gt;
</span><span class="cx">                         &lt;key&gt;xmlFiles&lt;/key&gt;
</span><span class="cx">                         &lt;array&gt;
</span><del>-                                &lt;string&gt;augments.xml&lt;/string&gt;
</del><span class="cx">                         &lt;/array&gt;
</span><span class="cx"> 
</span><span class="cx">                         &lt;key&gt;statSeconds&lt;/key&gt;
</span></span></pre></div>
<a id="CalendarServertrunkconfcaldavdtestplist"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/conf/caldavd-test.plist (15474 => 15475)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/conf/caldavd-test.plist        2016-03-14 19:41:46 UTC (rev 15474)
+++ CalendarServer/trunk/conf/caldavd-test.plist        2016-03-16 21:42:01 UTC (rev 15475)
</span><span class="lines">@@ -329,8 +329,6 @@
</span><span class="cx">     &lt;!-- XML File Augment Service --&gt;
</span><span class="cx">     &lt;key&gt;AugmentService&lt;/key&gt;
</span><span class="cx">     &lt;dict&gt;
</span><del>-      &lt;key&gt;Enabled&lt;/key&gt;
-      &lt;true/&gt;
</del><span class="cx">       &lt;key&gt;type&lt;/key&gt;
</span><span class="cx">       &lt;string&gt;xml&lt;/string&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavstdconfigpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/stdconfig.py (15474 => 15475)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/stdconfig.py        2016-03-14 19:41:46 UTC (rev 15474)
+++ CalendarServer/trunk/twistedcaldav/stdconfig.py        2016-03-16 21:42:01 UTC (rev 15475)
</span><span class="lines">@@ -117,7 +117,7 @@
</span><span class="cx"> 
</span><span class="cx"> DEFAULT_AUGMENT_PARAMS = {
</span><span class="cx">     &quot;xml&quot;: {
</span><del>-        &quot;xmlFiles&quot;: [&quot;augments.xml&quot;],
</del><ins>+        &quot;xmlFiles&quot;: [],
</ins><span class="cx">         &quot;statSeconds&quot;: 15,
</span><span class="cx">     },
</span><span class="cx"> }
</span><span class="lines">@@ -342,7 +342,6 @@
</span><span class="cx">     #    Augments for the directory service records to add calendar specific attributes.
</span><span class="cx">     #
</span><span class="cx">     &quot;AugmentService&quot;: {
</span><del>-        &quot;Enabled&quot;: True,
</del><span class="cx">         &quot;type&quot;: &quot;xml&quot;,
</span><span class="cx">         &quot;params&quot;: DEFAULT_AUGMENT_PARAMS[&quot;xml&quot;],
</span><span class="cx">     },
</span><span class="lines">@@ -1490,22 +1489,21 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> def _postUpdateAugmentService(configDict, reloading=False):
</span><del>-    if configDict.AugmentService.Enabled:
-        if configDict.AugmentService.type in DEFAULT_AUGMENT_PARAMS:
-            for param in tuple(configDict.AugmentService.params):
-                if param not in DEFAULT_AUGMENT_PARAMS[configDict.AugmentService.type]:
-                    log.warn(&quot;Parameter {p} is not supported by service {t}&quot;, p=param, t=configDict.AugmentService.type)
-                    del configDict.AugmentService.params[param]
</del><ins>+    if configDict.AugmentService.type in DEFAULT_AUGMENT_PARAMS:
+        for param in tuple(configDict.AugmentService.params):
+            if param not in DEFAULT_AUGMENT_PARAMS[configDict.AugmentService.type]:
+                log.warn(&quot;Parameter {p} is not supported by service {t}&quot;, p=param, t=configDict.AugmentService.type)
+                del configDict.AugmentService.params[param]
</ins><span class="cx"> 
</span><del>-        # Upgrading augments.xml must be done prior to using the store/directory
-        if configDict.AugmentService.type == &quot;xml&quot;:
-            for fileName in configDict.AugmentService.params.xmlFiles:
-                if fileName[0] not in (&quot;/&quot;, &quot;.&quot;):
-                    fileName = os.path.join(configDict.DataRoot, fileName)
-                filePath = FilePath(fileName)
-                if filePath.exists():
-                    from twistedcaldav.upgrade import upgradeAugmentsXML
-                    upgradeAugmentsXML(filePath)
</del><ins>+    # Upgrading augments.xml must be done prior to using the store/directory
+    if configDict.AugmentService.type == &quot;xml&quot;:
+        for fileName in configDict.AugmentService.params.xmlFiles:
+            if fileName[0] not in (&quot;/&quot;, &quot;.&quot;):
+                fileName = os.path.join(configDict.DataRoot, fileName)
+            filePath = FilePath(fileName)
+            if filePath.exists():
+                from twistedcaldav.upgrade import upgradeAugmentsXML
+                upgradeAugmentsXML(filePath)
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavtesttest_upgradepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/test/test_upgrade.py (15474 => 15475)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/test/test_upgrade.py        2016-03-14 19:41:46 UTC (rev 15474)
+++ CalendarServer/trunk/twistedcaldav/test/test_upgrade.py        2016-03-16 21:42:01 UTC (rev 15475)
</span><span class="lines">@@ -1511,6 +1511,7 @@
</span><span class="cx">     @inlineCallbacks
</span><span class="cx">     def test_migrateAutoSchedule(self):
</span><span class="cx"> 
</span><ins>+        self.patch(config.AugmentService, &quot;params&quot;, {&quot;xmlFiles&quot;:[&quot;augments.xml&quot;]})
</ins><span class="cx">         serviceClass = {
</span><span class="cx">             &quot;xml&quot;: &quot;twistedcaldav.directory.augment.AugmentXMLDB&quot;,
</span><span class="cx">         }
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavupgradepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/upgrade.py (15474 => 15475)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/upgrade.py        2016-03-14 19:41:46 UTC (rev 15474)
+++ CalendarServer/trunk/twistedcaldav/upgrade.py        2016-03-16 21:42:01 UTC (rev 15475)
</span><span class="lines">@@ -991,15 +991,14 @@
</span><span class="cx">     # Fetch the autoSchedule assignments from resourceinfo.sqlite and store
</span><span class="cx">     # the values in augments
</span><span class="cx">     augmentService = None
</span><del>-    if config.AugmentService.Enabled:
-        serviceClass = {
-            &quot;xml&quot;: &quot;twistedcaldav.directory.augment.AugmentXMLDB&quot;,
-        }
-        augmentClass = namedClass(serviceClass[config.AugmentService.type])
-        try:
-            augmentService = augmentClass(**config.AugmentService.params)
-        except:
-            log.error(&quot;Could not start augment service&quot;)
</del><ins>+    serviceClass = {
+        &quot;xml&quot;: &quot;twistedcaldav.directory.augment.AugmentXMLDB&quot;,
+    }
+    augmentClass = namedClass(serviceClass[config.AugmentService.type])
+    try:
+        augmentService = augmentClass(**config.AugmentService.params)
+    except:
+        log.error(&quot;Could not start augment service&quot;)
</ins><span class="cx"> 
</span><span class="cx">     if augmentService:
</span><span class="cx">         augmentRecords = []
</span></span></pre></div>
<a id="CalendarServertrunktxdavwhotesttest_utilpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/who/test/test_util.py (15474 => 15475)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/who/test/test_util.py        2016-03-14 19:41:46 UTC (rev 15474)
+++ CalendarServer/trunk/txdav/who/test/test_util.py        2016-03-16 21:42:01 UTC (rev 15475)
</span><span class="lines">@@ -99,7 +99,6 @@
</span><span class="cx">                     },
</span><span class="cx">                 },
</span><span class="cx">                 &quot;AugmentService&quot;: {
</span><del>-                    &quot;Enabled&quot;: True,
</del><span class="cx">                     &quot;type&quot;: &quot;xml&quot;,
</span><span class="cx">                     &quot;params&quot;: {
</span><span class="cx">                         &quot;xmlFiles&quot;: [&quot;augments.xml&quot;],
</span></span></pre></div>
<a id="CalendarServertrunktxdavwhoutilpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/who/util.py (15474 => 15475)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/who/util.py        2016-03-14 19:41:46 UTC (rev 15474)
+++ CalendarServer/trunk/txdav/who/util.py        2016-03-16 21:42:01 UTC (rev 15475)
</span><span class="lines">@@ -154,6 +154,7 @@
</span><span class="cx">                     LDAPFieldName.memberDNs: mapping.memberDNs,
</span><span class="cx">                     CalFieldName.readOnlyProxy: mapping.readOnlyProxy,
</span><span class="cx">                     CalFieldName.readWriteProxy: mapping.readWriteProxy,
</span><ins>+                    CalFieldName.loginAllowed: mapping.loginAllowed,
</ins><span class="cx">                     CalFieldName.hasCalendars: mapping.hasCalendars,
</span><span class="cx">                     CalFieldName.autoScheduleMode: mapping.autoScheduleMode,
</span><span class="cx">                     CalFieldName.autoAcceptGroup: mapping.autoAcceptGroup,
</span><span class="lines">@@ -240,29 +241,26 @@
</span><span class="cx">     #
</span><span class="cx">     # Setup the Augment Service
</span><span class="cx">     #
</span><del>-    if augmentServiceInfo.Enabled:
-        serviceClass = {
-            &quot;xml&quot;: &quot;twistedcaldav.directory.augment.AugmentXMLDB&quot;,
-        }
</del><ins>+    serviceClass = {
+        &quot;xml&quot;: &quot;twistedcaldav.directory.augment.AugmentXMLDB&quot;,
+    }
</ins><span class="cx"> 
</span><del>-        for augmentFile in augmentServiceInfo.params.xmlFiles:
-            augmentFile = fullServerPath(dataRoot, augmentFile)
-            augmentFilePath = FilePath(augmentFile)
-            if not augmentFilePath.exists():
-                augmentFilePath.setContent(DEFAULT_AUGMENT_CONTENT)
</del><ins>+    for augmentFile in augmentServiceInfo.params.xmlFiles:
+        augmentFile = fullServerPath(dataRoot, augmentFile)
+        augmentFilePath = FilePath(augmentFile)
+        if not augmentFilePath.exists():
+            augmentFilePath.setContent(DEFAULT_AUGMENT_CONTENT)
</ins><span class="cx"> 
</span><del>-        augmentClass = namedClass(serviceClass[augmentServiceInfo.type])
-        log.info(
-            &quot;Configuring augment service of type: {augmentClass}&quot;,
-            augmentClass=augmentClass
-        )
-        try:
-            augmentService = augmentClass(**augmentServiceInfo.params)
-        except IOError:
-            log.error(&quot;Could not start augment service&quot;)
-            raise
-    else:
-        augmentService = None
</del><ins>+    augmentClass = namedClass(serviceClass[augmentServiceInfo.type])
+    log.info(
+        &quot;Configuring augment service of type: {augmentClass}&quot;,
+        augmentClass=augmentClass
+    )
+    try:
+        augmentService = augmentClass(**augmentServiceInfo.params)
+    except IOError:
+        log.error(&quot;Could not start augment service&quot;)
+        raise
</ins><span class="cx"> 
</span><span class="cx">     userDirectory = None
</span><span class="cx">     for directory in aggregatedServices:
</span></span></pre>
</div>
</div>

</body>
</html>