<!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>[12897] CalendarServer/branches/users/sagen/move2who-2</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/12897">12897</a></dd>
<dt>Author</dt> <dd>sagen@apple.com</dd>
<dt>Date</dt> <dd>2014-03-13 13:33:25 -0700 (Thu, 13 Mar 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move directoryFromConfig to its own module.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServerbranchesuserssagenmove2who2calendarservertapcaldavpy">CalendarServer/branches/users/sagen/move2who-2/calendarserver/tap/caldav.py</a></li>
<li><a href="#CalendarServerbranchesuserssagenmove2who2calendarservertaptesttest_utilpy">CalendarServer/branches/users/sagen/move2who-2/calendarserver/tap/test/test_util.py</a></li>
<li><a href="#CalendarServerbranchesuserssagenmove2who2calendarservertoolstesttest_principalspy">CalendarServer/branches/users/sagen/move2who-2/calendarserver/tools/test/test_principals.py</a></li>
<li><a href="#CalendarServerbranchesuserssagenmove2who2twistedcaldavstdconfigpy">CalendarServer/branches/users/sagen/move2who-2/twistedcaldav/stdconfig.py</a></li>
<li><a href="#CalendarServerbranchesuserssagenmove2who2twistedcaldavtestutilpy">CalendarServer/branches/users/sagen/move2who-2/twistedcaldav/test/util.py</a></li>
<li><a href="#CalendarServerbranchesuserssagenmove2who2txdavcaldavdatastoretesttest_attachmentspy">CalendarServer/branches/users/sagen/move2who-2/txdav/caldav/datastore/test/test_attachments.py</a></li>
<li><a href="#CalendarServerbranchesuserssagenmove2who2txdavdpsclientpy">CalendarServer/branches/users/sagen/move2who-2/txdav/dps/client.py</a></li>
<li><a href="#CalendarServerbranchesuserssagenmove2who2txdavdpsserverpy">CalendarServer/branches/users/sagen/move2who-2/txdav/dps/server.py</a></li>
<li><a href="#CalendarServerbranchesuserssagenmove2who2txdavwhodirectorypy">CalendarServer/branches/users/sagen/move2who-2/txdav/who/directory.py</a></li>
<li><a href="#CalendarServerbranchesuserssagenmove2who2txdavwhotestaccountsaccountsxml">CalendarServer/branches/users/sagen/move2who-2/txdav/who/test/accounts/accounts.xml</a></li>
<li><a href="#CalendarServerbranchesuserssagenmove2who2txdavwhotestaccountsresourcesxml">CalendarServer/branches/users/sagen/move2who-2/txdav/who/test/accounts/resources.xml</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#CalendarServerbranchesuserssagenmove2who2txdavwhotestaccountsaugmentsxml">CalendarServer/branches/users/sagen/move2who-2/txdav/who/test/accounts/augments.xml</a></li>
<li><a href="#CalendarServerbranchesuserssagenmove2who2txdavwhotesttest_utilpy">CalendarServer/branches/users/sagen/move2who-2/txdav/who/test/test_util.py</a></li>
<li><a href="#CalendarServerbranchesuserssagenmove2who2txdavwhoutilpy">CalendarServer/branches/users/sagen/move2who-2/txdav/who/util.py</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServerbranchesuserssagenmove2who2calendarservertapcaldavpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-2/calendarserver/tap/caldav.py (12896 => 12897)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-2/calendarserver/tap/caldav.py        2014-03-13 19:14:42 UTC (rev 12896)
+++ CalendarServer/branches/users/sagen/move2who-2/calendarserver/tap/caldav.py        2014-03-13 20:33:25 UTC (rev 12897)
</span><span class="lines">@@ -86,7 +86,7 @@
</span><span class="cx"> from txdav.common.datastore.work.revision_cleanup import (
</span><span class="cx">     scheduleFirstFindMinRevision
</span><span class="cx"> )
</span><del>-from txdav.dps.server import directoryFromConfig
</del><ins>+from txdav.who.util import directoryFromConfig
</ins><span class="cx"> from txdav.dps.client import DirectoryService as DirectoryProxyClientService
</span><span class="cx"> from txdav.who.groups import GroupCacher
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagenmove2who2calendarservertaptesttest_utilpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-2/calendarserver/tap/test/test_util.py (12896 => 12897)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-2/calendarserver/tap/test/test_util.py        2014-03-13 19:14:42 UTC (rev 12896)
+++ CalendarServer/branches/users/sagen/move2who-2/calendarserver/tap/test/test_util.py        2014-03-13 20:33:25 UTC (rev 12897)
</span><span class="lines">@@ -21,7 +21,7 @@
</span><span class="cx"> from twistedcaldav.directory.augment import AugmentXMLDB
</span><span class="cx"> from twisted.internet.task import Clock
</span><span class="cx"> from twisted.internet.defer import succeed, inlineCallbacks
</span><del>-from txdav.dps.server import directoryFromConfig
</del><ins>+from txdav.who.util import directoryFromConfig
</ins><span class="cx"> 
</span><span class="cx"> class ProcessCountTestCase(TestCase):
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagenmove2who2calendarservertoolstesttest_principalspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-2/calendarserver/tools/test/test_principals.py (12896 => 12897)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-2/calendarserver/tools/test/test_principals.py        2014-03-13 19:14:42 UTC (rev 12896)
+++ CalendarServer/branches/users/sagen/move2who-2/calendarserver/tools/test/test_principals.py        2014-03-13 20:33:25 UTC (rev 12897)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx"> from twistedcaldav.test.util import (
</span><span class="cx">     TestCase, CapturingProcessProtocol, ErrorOutput
</span><span class="cx"> )
</span><del>-from txdav.dps.server import directoryFromConfig
</del><ins>+from txdav.who.util import directoryFromConfig
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagenmove2who2twistedcaldavstdconfigpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-2/twistedcaldav/stdconfig.py (12896 => 12897)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-2/twistedcaldav/stdconfig.py        2014-03-13 19:14:42 UTC (rev 12896)
+++ CalendarServer/branches/users/sagen/move2who-2/twistedcaldav/stdconfig.py        2014-03-13 20:33:25 UTC (rev 12897)
</span><span class="lines">@@ -374,6 +374,7 @@
</span><span class="cx">     #    users, groups, locations and resources) to the server.
</span><span class="cx">     #
</span><span class="cx">     &quot;DirectoryService&quot;: {
</span><ins>+        &quot;Enabled&quot;: True,
</ins><span class="cx">         &quot;type&quot;: &quot;twistedcaldav.directory.xmlfile.XMLDirectoryService&quot;,
</span><span class="cx">         &quot;params&quot;: DEFAULT_SERVICE_PARAMS[&quot;twistedcaldav.directory.xmlfile.XMLDirectoryService&quot;],
</span><span class="cx">     },
</span><span class="lines">@@ -385,7 +386,7 @@
</span><span class="cx">     #    and resources.
</span><span class="cx">     #
</span><span class="cx">     &quot;ResourceService&quot;: {
</span><del>-        &quot;Enabled&quot; : True,
</del><ins>+        &quot;Enabled&quot;: True,
</ins><span class="cx">         &quot;type&quot;: &quot;twistedcaldav.directory.xmlfile.XMLDirectoryService&quot;,
</span><span class="cx">         &quot;params&quot;: DEFAULT_RESOURCE_PARAMS[&quot;twistedcaldav.directory.xmlfile.XMLDirectoryService&quot;],
</span><span class="cx">     },
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagenmove2who2twistedcaldavtestutilpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-2/twistedcaldav/test/util.py (12896 => 12897)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-2/twistedcaldav/test/util.py        2014-03-13 19:14:42 UTC (rev 12896)
+++ CalendarServer/branches/users/sagen/move2who-2/twistedcaldav/test/util.py        2014-03-13 20:33:25 UTC (rev 12897)
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx"> from txdav.caldav.datastore.test.util import buildCalendarStore
</span><span class="cx"> from txdav.common.datastore.file import CommonDataStore
</span><span class="cx"> from txdav.common.datastore.test.util import deriveQuota, CommonCommonTests
</span><del>-from txdav.dps.server import directoryFromConfig
</del><ins>+from txdav.who.util import directoryFromConfig
</ins><span class="cx"> from txdav.xml import element as davxml, element
</span><span class="cx"> from txweb2.dav.test.util import SimpleRequest
</span><span class="cx"> import txweb2.dav.test.util
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagenmove2who2txdavcaldavdatastoretesttest_attachmentspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-2/txdav/caldav/datastore/test/test_attachments.py (12896 => 12897)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-2/txdav/caldav/datastore/test/test_attachments.py        2014-03-13 19:14:42 UTC (rev 12896)
+++ CalendarServer/branches/users/sagen/move2who-2/txdav/caldav/datastore/test/test_attachments.py        2014-03-13 20:33:25 UTC (rev 12897)
</span><span class="lines">@@ -14,7 +14,7 @@
</span><span class="cx"> # limitations under the License.
</span><span class="cx"> ##
</span><span class="cx"> 
</span><del>-from txdav.dps.server import directoryFromConfig
</del><ins>+from txdav.who.util import directoryFromConfig
</ins><span class="cx"> 
</span><span class="cx"> from pycalendar.datetime import DateTime
</span><span class="cx"> from pycalendar.value import Value
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagenmove2who2txdavdpsclientpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-2/txdav/dps/client.py (12896 => 12897)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-2/txdav/dps/client.py        2014-03-13 19:14:42 UTC (rev 12896)
+++ CalendarServer/branches/users/sagen/move2who-2/txdav/dps/client.py        2014-03-13 20:33:25 UTC (rev 12897)
</span><span class="lines">@@ -226,7 +226,9 @@
</span><span class="cx">             recordType=recordType.name.encode(&quot;utf-8&quot;)
</span><span class="cx">         )
</span><span class="cx"> 
</span><ins>+    listRecords = recordsWithRecordType
</ins><span class="cx"> 
</span><ins>+
</ins><span class="cx">     def recordsWithEmailAddress(self, emailAddress):
</span><span class="cx">         return self._call(
</span><span class="cx">             RecordsWithEmailAddressCommand,
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagenmove2who2txdavdpsserverpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-2/txdav/dps/server.py (12896 => 12897)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-2/txdav/dps/server.py        2014-03-13 19:14:42 UTC (rev 12896)
+++ CalendarServer/branches/users/sagen/move2who-2/txdav/dps/server.py        2014-03-13 20:33:25 UTC (rev 12897)
</span><span class="lines">@@ -15,28 +15,20 @@
</span><span class="cx"> ##
</span><span class="cx"> 
</span><span class="cx"> import cPickle as pickle
</span><del>-import os
</del><span class="cx"> import uuid
</span><span class="cx"> 
</span><del>-from calendarserver.tap.util import getDBPool, storeFromConfig
</del><span class="cx"> from twext.python.log import Logger
</span><del>-from twext.who.aggregate import DirectoryService as AggregateDirectoryService
</del><span class="cx"> from twext.who.expression import MatchType, MatchFlags, Operand
</span><del>-from twext.who.idirectory import RecordType, DirectoryConfigurationError
-from twext.who.ldap import DirectoryService as LDAPDirectoryService
-from twext.who.util import ConstantsContainer
</del><ins>+from twext.who.idirectory import RecordType
</ins><span class="cx"> from twisted.application import service
</span><span class="cx"> from twisted.application.strports import service as strPortsService
</span><del>-from twisted.cred.credentials import UsernamePassword
</del><span class="cx"> from twisted.internet.defer import inlineCallbacks, returnValue
</span><span class="cx"> from twisted.internet.protocol import Factory
</span><span class="cx"> from twisted.plugin import IPlugin
</span><span class="cx"> from twisted.protocols import amp
</span><span class="cx"> from twisted.python.constants import Names, NamedConstant
</span><del>-from twisted.python.filepath import FilePath
-from twisted.python.reflect import namedClass
</del><span class="cx"> from twisted.python.usage import Options, UsageError
</span><del>-from twistedcaldav.config import config, fullServerPath
</del><ins>+from twistedcaldav.config import config
</ins><span class="cx"> from twistedcaldav.stdconfig import DEFAULT_CONFIG, DEFAULT_CONFIG_FILE
</span><span class="cx"> from txdav.dps.commands import (
</span><span class="cx">     RecordWithShortNameCommand, RecordWithUIDCommand, RecordWithGUIDCommand,
</span><span class="lines">@@ -46,12 +38,10 @@
</span><span class="cx">     VerifyPlaintextPasswordCommand, VerifyHTTPDigestCommand,
</span><span class="cx">     # UpdateRecordsCommand, RemoveRecordsCommand
</span><span class="cx"> )
</span><del>-from txdav.who.augment import AugmentedDirectoryService
-from txdav.who.delegates import DirectoryService as DelegateDirectoryService
-from txdav.who.idirectory import RecordType as CalRecordType
-from txdav.who.xml import DirectoryService as XMLDirectoryService
</del><ins>+from txdav.who.util import directoryFromConfig
</ins><span class="cx"> from zope.interface import implementer
</span><span class="cx"> 
</span><ins>+
</ins><span class="cx"> log = Logger()
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -449,130 +439,6 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-def directoryFromConfig(config, store=None):
-    &quot;&quot;&quot;
-    Return a directory service based on the config.  If you want to go through
-    AMP to talk to one of these as a client, instantiate
-    txdav.dps.client.DirectoryService
-    &quot;&quot;&quot;
-
-    # MOVE2WHO FIXME: this needs to talk to its own separate database.  In fact,
-    # don't pass store=None if you already have called storeFromConfig()
-    # within this process.  Pass the existing store in here.
-    pool, txnFactory = getDBPool(config)
-    if store is None:
-        store = storeFromConfig(config, txnFactory, None)
-
-    aggregatedServices = []
-
-    for serviceKey in (&quot;DirectoryService&quot;, &quot;ResourceService&quot;):
-        serviceValue = config.get(serviceKey, None)
-        directoryType = serviceValue.type.lower()
-        params = serviceValue.params
-
-        if &quot;xml&quot; in directoryType:
-            xmlFile = params.xmlFile
-            xmlFile = fullServerPath(config.DataRoot, xmlFile)
-            # path = kwds.pop(&quot;path&quot;, &quot;&quot;)
-            if not xmlFile or not os.path.exists(xmlFile):
-                log.error(&quot;Path not found for XML directory: {p}&quot;, p=xmlFile)
-            fp = FilePath(xmlFile)
-            directory = XMLDirectoryService(fp)
-
-        elif &quot;opendirectory&quot; in directoryType:
-            from twext.who.opendirectory import DirectoryService as ODDirectoryService
-            directory = ODDirectoryService()
-
-        elif &quot;ldap&quot; in directoryType:
-            if params.credentials.dn and params.credentials.password:
-                creds = UsernamePassword(params.credentials.dn,
-                                         params.credentials.password)
-            else:
-                creds = None
-            directory = LDAPDirectoryService(
-                params.uri,
-                params.rdnSchema.base,
-                creds=creds
-            )
-
-        else:
-            log.error(&quot;Invalid DirectoryType: {dt}&quot;, dt=directoryType)
-            raise DirectoryConfigurationError
-
-        # Set the appropriate record types on each service
-        types = []
-        for recordTypeName in params.recordTypes:
-            recordType = {
-                &quot;users&quot;: RecordType.user,
-                &quot;groups&quot;: RecordType.group,
-                &quot;locations&quot;: CalRecordType.location,
-                &quot;resources&quot;: CalRecordType.resource,
-                &quot;addresses&quot;: CalRecordType.address,
-            }.get(recordTypeName, None)
-            if recordType is None:
-                log.error(&quot;Invalid Record Type: {rt}&quot;, rt=recordTypeName)
-                raise DirectoryConfigurationError
-            if recordType in types:
-                log.error(&quot;Duplicate Record Type: {rt}&quot;, rt=recordTypeName)
-                raise DirectoryConfigurationError
-            types.append(recordType)
-
-        directory.recordType = ConstantsContainer(types)
-        aggregatedServices.append(directory)
-
-    #
-    # Setup the Augment Service
-    #
-    if config.AugmentService.type:
-        augmentClass = namedClass(config.AugmentService.type)
-        log.info(
-            &quot;Configuring augment service of type: {augmentClass}&quot;,
-            augmentClass=augmentClass
-        )
-        try:
-            augmentService = augmentClass(**config.AugmentService.params)
-        except IOError:
-            log.error(&quot;Could not start augment service&quot;)
-            raise
-    else:
-        augmentService = None
-
-    userDirectory = None
-    for directory in aggregatedServices:
-        if RecordType.user in directory.recordTypes():
-            userDirectory = directory
-            break
-    else:
-        log.error(&quot;No directory service set up for users&quot;)
-        raise DirectoryConfigurationError
-
-    delegateDirectory = DelegateDirectoryService(
-        userDirectory.realmName,
-        store
-    )
-    aggregatedServices.append(delegateDirectory)
-
-    aggregateDirectory = AggregateDirectoryService(
-        userDirectory.realmName, aggregatedServices
-    )
-    try:
-        augmented = AugmentedDirectoryService(
-            aggregateDirectory, store, augmentService
-        )
-
-        # The delegate directory needs a way to look up user/group records
-        # so hand it a reference to the augmented directory.
-        # FIXME: is there a better pattern to use here?
-        delegateDirectory.setMasterDirectory(augmented)
-
-    except Exception as e:
-        log.error(&quot;Could not create directory service&quot;, error=e)
-        raise
-
-    return augmented
-
-
-
</del><span class="cx"> @implementer(IPlugin, service.IServiceMaker)
</span><span class="cx"> class DirectoryProxyServiceMaker(object):
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagenmove2who2txdavwhodirectorypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-2/txdav/who/directory.py (12896 => 12897)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-2/txdav/who/directory.py        2014-03-13 19:14:42 UTC (rev 12896)
+++ CalendarServer/branches/users/sagen/move2who-2/txdav/who/directory.py        2014-03-13 20:33:25 UTC (rev 12897)
</span><span class="lines">@@ -28,11 +28,9 @@
</span><span class="cx"> from twext.who.idirectory import RecordType as BaseRecordType
</span><span class="cx"> from twisted.cred.credentials import UsernamePassword
</span><span class="cx"> from twisted.internet.defer import inlineCallbacks, returnValue
</span><del>-from txdav.caldav.datastore.scheduling.cuaddress import normalizeCUAddr
</del><span class="cx"> from txdav.who.idirectory import RecordType as DAVRecordType
</span><span class="cx"> from txweb2.auth.digest import DigestedCredentials
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> log = Logger()
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -42,6 +40,7 @@
</span><span class="cx"> ]
</span><span class="cx"> 
</span><span class="cx"> 
</span><ins>+
</ins><span class="cx"> class CalendarDirectoryServiceMixin(object):
</span><span class="cx"> 
</span><span class="cx">     guid = &quot;1332A615-4D3A-41FE-B636-FBE25BFB982E&quot;
</span><span class="lines">@@ -59,6 +58,8 @@
</span><span class="cx"> 
</span><span class="cx">     @inlineCallbacks
</span><span class="cx">     def recordWithCalendarUserAddress(self, address):
</span><ins>+        # FIXME: moved this here to avoid circular import problems
+        from txdav.caldav.datastore.scheduling.cuaddress import normalizeCUAddr
</ins><span class="cx">         address = normalizeCUAddr(address)
</span><span class="cx">         record = None
</span><span class="cx">         if address.startswith(&quot;urn:uuid:&quot;):
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagenmove2who2txdavwhotestaccountsaccountsxml"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-2/txdav/who/test/accounts/accounts.xml (12896 => 12897)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-2/txdav/who/test/accounts/accounts.xml        2014-03-13 19:14:42 UTC (rev 12896)
+++ CalendarServer/branches/users/sagen/move2who-2/txdav/who/test/accounts/accounts.xml        2014-03-13 20:33:25 UTC (rev 12897)
</span><span class="lines">@@ -18,175 +18,339 @@
</span><span class="cx"> 
</span><span class="cx"> &lt;!DOCTYPE accounts SYSTEM &quot;accounts.dtd&quot;&gt;
</span><span class="cx"> 
</span><del>-&lt;accounts realm=&quot;Test Realm&quot;&gt;
-  &lt;user&gt;
</del><ins>+&lt;directory realm=&quot;Test Realm&quot;&gt;
+  &lt;record type=&quot;user&quot;&gt;
</ins><span class="cx">     &lt;uid&gt;admin&lt;/uid&gt;
</span><del>-    &lt;guid&gt;admin&lt;/guid&gt;
</del><ins>+    &lt;short-name&gt;admin&lt;/short-name&gt;
</ins><span class="cx">     &lt;password&gt;admin&lt;/password&gt;
</span><del>-    &lt;name&gt;Super User&lt;/name&gt;
-    &lt;first-name&gt;Super&lt;/first-name&gt;
-    &lt;last-name&gt;User&lt;/last-name&gt;
-  &lt;/user&gt;
-  &lt;user&gt;
</del><ins>+    &lt;full-name&gt;Super User&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;user&quot;&gt;
</ins><span class="cx">     &lt;uid&gt;apprentice&lt;/uid&gt;
</span><del>-    &lt;guid&gt;apprentice&lt;/guid&gt;
</del><ins>+    &lt;short-name&gt;apprentice&lt;/short-name&gt;
</ins><span class="cx">     &lt;password&gt;apprentice&lt;/password&gt;
</span><del>-    &lt;name&gt;Apprentice Super User&lt;/name&gt;
-    &lt;first-name&gt;Apprentice&lt;/first-name&gt;
-    &lt;last-name&gt;Super User&lt;/last-name&gt;
-  &lt;/user&gt;
-  &lt;user&gt;
</del><ins>+    &lt;full-name&gt;Apprentice Super User&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;user&quot;&gt;
</ins><span class="cx">     &lt;uid&gt;wsanchez&lt;/uid&gt;
</span><del>-    &lt;guid&gt;wsanchez&lt;/guid&gt;
-    &lt;email-address&gt;wsanchez@example.com&lt;/email-address&gt;
</del><ins>+    &lt;short-name&gt;wsanchez&lt;/short-name&gt;
+    &lt;email&gt;wsanchez@example.com&lt;/email&gt;
</ins><span class="cx">     &lt;password&gt;test&lt;/password&gt;
</span><del>-    &lt;name&gt;Wilfredo Sanchez Vega&lt;/name&gt;
-    &lt;first-name&gt;Wilfredo&lt;/first-name&gt;
-    &lt;last-name&gt;Sanchez Vega&lt;/last-name&gt;
-    &lt;auto-schedule-mode&gt;&lt;accept-if-free-decline-if-busy /&gt;&lt;/auto-schedule-mode&gt;
-  &lt;/user&gt;
-  &lt;user&gt;
</del><ins>+    &lt;full-name&gt;Wilfredo Sanchez Vega&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;user&quot;&gt;
</ins><span class="cx">     &lt;uid&gt;cdaboo&lt;/uid&gt;
</span><del>-    &lt;guid&gt;cdaboo&lt;/guid&gt;
-    &lt;email-address&gt;cdaboo@example.com&lt;/email-address&gt;
</del><ins>+    &lt;short-name&gt;cdaboo&lt;/short-name&gt;
+    &lt;email&gt;cdaboo@example.com&lt;/email&gt;
</ins><span class="cx">     &lt;password&gt;test&lt;/password&gt;
</span><del>-    &lt;name&gt;Cyrus Daboo&lt;/name&gt;
-    &lt;first-name&gt;Cyrus&lt;/first-name&gt;
-    &lt;last-name&gt;Daboo&lt;/last-name&gt;
-  &lt;/user&gt;
-  &lt;user&gt;
</del><ins>+    &lt;full-name&gt;cyrus Daboo&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;user&quot;&gt;
</ins><span class="cx">     &lt;uid&gt;sagen&lt;/uid&gt;
</span><del>-    &lt;guid&gt;sagen&lt;/guid&gt;
-    &lt;email-address&gt;sagen@example.com&lt;/email-address&gt;
</del><ins>+    &lt;short-name&gt;sagen&lt;/short-name&gt;
+    &lt;email&gt;sagen@example.com&lt;/email&gt;
</ins><span class="cx">     &lt;password&gt;test&lt;/password&gt;
</span><del>-    &lt;name&gt;Morgen Sagen&lt;/name&gt;
-    &lt;first-name&gt;Morgen&lt;/first-name&gt;
-    &lt;last-name&gt;Sagen&lt;/last-name&gt;
-  &lt;/user&gt;
-  &lt;user&gt;
</del><ins>+    &lt;full-name&gt;Morgen Sagen&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;user&quot;&gt;
</ins><span class="cx">     &lt;uid&gt;dre&lt;/uid&gt;
</span><del>-    &lt;guid&gt;andre&lt;/guid&gt;
-    &lt;email-address&gt;dre@example.com&lt;/email-address&gt;
</del><ins>+    &lt;short-name&gt;andre&lt;/short-name&gt;
+    &lt;email&gt;dre@example.com&lt;/email&gt;
</ins><span class="cx">     &lt;password&gt;test&lt;/password&gt;
</span><del>-    &lt;name&gt;Andre LaBranche&lt;/name&gt;
-    &lt;first-name&gt;Andre&lt;/first-name&gt;
-    &lt;last-name&gt;LaBranche&lt;/last-name&gt;
-  &lt;/user&gt;
-  &lt;user&gt;
</del><ins>+    &lt;full-name&gt;Andre LaBranche&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;user&quot;&gt;
</ins><span class="cx">     &lt;uid&gt;glyph&lt;/uid&gt;
</span><del>-    &lt;guid&gt;glyph&lt;/guid&gt;
-    &lt;email-address&gt;glyph@example.com&lt;/email-address&gt;
</del><ins>+    &lt;short-name&gt;glyph&lt;/short-name&gt;
+    &lt;email&gt;glyph@example.com&lt;/email&gt;
</ins><span class="cx">     &lt;password&gt;test&lt;/password&gt;
</span><del>-    &lt;name&gt;Glyph Lefkowitz&lt;/name&gt;
-    &lt;first-name&gt;Glyph&lt;/first-name&gt;
-    &lt;last-name&gt;Lefkowitz&lt;/last-name&gt;
-  &lt;/user&gt;
-  &lt;user&gt;
</del><ins>+    &lt;full-name&gt;Glyph Lefkowitz&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;user&quot;&gt;
</ins><span class="cx">     &lt;uid&gt;i18nuser&lt;/uid&gt;
</span><del>-    &lt;guid&gt;i18nuser&lt;/guid&gt;
-    &lt;email-address&gt;i18nuser@example.com&lt;/email-address&gt;
</del><ins>+    &lt;short-name&gt;i18nuser&lt;/short-name&gt;
+    &lt;email&gt;i18nuser@example.com&lt;/email&gt;
</ins><span class="cx">     &lt;password&gt;i18nuser&lt;/password&gt;
</span><del>-    &lt;name&gt;まだ&lt;/name&gt;
-    &lt;first-name&gt;ま&lt;/first-name&gt;
-    &lt;last-name&gt;だ&lt;/last-name&gt;
-  &lt;/user&gt;
</del><ins>+    &lt;full-name&gt;まだ&lt;/full-name&gt;
+  &lt;/record&gt;
+
+  &lt;!-- twext.who xml doesn't (yet) support repeat
</ins><span class="cx">   &lt;user repeat=&quot;101&quot;&gt;
</span><span class="cx">     &lt;uid&gt;user%02d&lt;/uid&gt;
</span><span class="cx">     &lt;uid&gt;User %02d&lt;/uid&gt;
</span><del>-    &lt;guid&gt;user%02d&lt;/guid&gt;
</del><ins>+    &lt;short-name&gt;user%02d&lt;/short-name&gt;
</ins><span class="cx">     &lt;password&gt;user%02d&lt;/password&gt;
</span><del>-    &lt;name&gt;User %02d&lt;/name&gt;
-    &lt;first-name&gt;User&lt;/first-name&gt;
-    &lt;last-name&gt;%02d&lt;/last-name&gt;
-    &lt;email-address&gt;user%02d@example.com&lt;/email-address&gt;
-  &lt;/user&gt;
</del><ins>+    &lt;full-name&gt;User %02d&lt;/full-name&gt;
+    &lt;email&gt;user%02d@example.com&lt;/email&gt;
+  &lt;/record&gt;
</ins><span class="cx">   &lt;user repeat=&quot;10&quot;&gt;
</span><span class="cx">     &lt;uid&gt;public%02d&lt;/uid&gt;
</span><del>-    &lt;guid&gt;public%02d&lt;/guid&gt;
</del><ins>+    &lt;short-name&gt;public%02d&lt;/short-name&gt;
</ins><span class="cx">     &lt;password&gt;public%02d&lt;/password&gt;
</span><del>-    &lt;name&gt;Public %02d&lt;/name&gt;
-    &lt;first-name&gt;Public&lt;/first-name&gt;
-    &lt;last-name&gt;%02d&lt;/last-name&gt;
-  &lt;/user&gt;
-  &lt;group&gt;
</del><ins>+    &lt;full-name&gt;Public %02d&lt;/full-name&gt;
+  &lt;/record&gt;
+  --&gt;
+  &lt;record type=&quot;user&quot;&gt;
+    &lt;short-name&gt;user01&lt;/short-name&gt;
+    &lt;uid&gt;user01&lt;/uid&gt;
+    &lt;password&gt;user01&lt;/password&gt;
+    &lt;full-name&gt;User 01&lt;/full-name&gt;
+    &lt;email&gt;user01@example.com&lt;/email&gt;
+  &lt;/record&gt;
+
+  &lt;record type=&quot;user&quot;&gt;
+    &lt;short-name&gt;user02&lt;/short-name&gt;
+    &lt;uid&gt;user02&lt;/uid&gt;
+    &lt;password&gt;user02&lt;/password&gt;
+    &lt;full-name&gt;User 02&lt;/full-name&gt;
+    &lt;email&gt;user02@example.com&lt;/email&gt;
+  &lt;/record&gt;
+
+  &lt;record type=&quot;user&quot;&gt;
+    &lt;short-name&gt;user03&lt;/short-name&gt;
+    &lt;uid&gt;user03&lt;/uid&gt;
+    &lt;password&gt;user03&lt;/password&gt;
+    &lt;full-name&gt;User 03&lt;/full-name&gt;
+    &lt;email&gt;user03@example.com&lt;/email&gt;
+  &lt;/record&gt;
+
+  &lt;record type=&quot;user&quot;&gt;
+    &lt;short-name&gt;user04&lt;/short-name&gt;
+    &lt;uid&gt;user04&lt;/uid&gt;
+    &lt;password&gt;user04&lt;/password&gt;
+    &lt;full-name&gt;User 04&lt;/full-name&gt;
+    &lt;email&gt;user04@example.com&lt;/email&gt;
+  &lt;/record&gt;
+
+  &lt;record type=&quot;user&quot;&gt;
+    &lt;short-name&gt;user05&lt;/short-name&gt;
+    &lt;uid&gt;user05&lt;/uid&gt;
+    &lt;password&gt;user05&lt;/password&gt;
+    &lt;full-name&gt;User 05&lt;/full-name&gt;
+    &lt;email&gt;user05@example.com&lt;/email&gt;
+  &lt;/record&gt;
+
+  &lt;record type=&quot;user&quot;&gt;
+    &lt;short-name&gt;user06&lt;/short-name&gt;
+    &lt;uid&gt;user06&lt;/uid&gt;
+    &lt;password&gt;user06&lt;/password&gt;
+    &lt;full-name&gt;User 06&lt;/full-name&gt;
+    &lt;email&gt;user06@example.com&lt;/email&gt;
+  &lt;/record&gt;
+
+  &lt;record type=&quot;user&quot;&gt;
+    &lt;short-name&gt;user07&lt;/short-name&gt;
+    &lt;uid&gt;user07&lt;/uid&gt;
+    &lt;password&gt;user07&lt;/password&gt;
+    &lt;full-name&gt;User 07&lt;/full-name&gt;
+    &lt;email&gt;user07@example.com&lt;/email&gt;
+  &lt;/record&gt;
+
+  &lt;record type=&quot;user&quot;&gt;
+    &lt;short-name&gt;user08&lt;/short-name&gt;
+    &lt;uid&gt;user08&lt;/uid&gt;
+    &lt;password&gt;user08&lt;/password&gt;
+    &lt;full-name&gt;User 08&lt;/full-name&gt;
+    &lt;email&gt;user08@example.com&lt;/email&gt;
+  &lt;/record&gt;
+
+  &lt;record type=&quot;user&quot;&gt;
+    &lt;short-name&gt;user09&lt;/short-name&gt;
+    &lt;uid&gt;user09&lt;/uid&gt;
+    &lt;password&gt;user09&lt;/password&gt;
+    &lt;full-name&gt;User 09&lt;/full-name&gt;
+    &lt;email&gt;user09@example.com&lt;/email&gt;
+  &lt;/record&gt;
+
+  &lt;record type=&quot;user&quot;&gt;
+    &lt;short-name&gt;user10&lt;/short-name&gt;
+    &lt;uid&gt;user10&lt;/uid&gt;
+    &lt;password&gt;user10&lt;/password&gt;
+    &lt;full-name&gt;User 10&lt;/full-name&gt;
+    &lt;email&gt;user10@example.com&lt;/email&gt;
+  &lt;/record&gt;
+
+  &lt;record type=&quot;user&quot;&gt;
+    &lt;short-name&gt;user11&lt;/short-name&gt;
+    &lt;uid&gt;user11&lt;/uid&gt;
+    &lt;password&gt;user11&lt;/password&gt;
+    &lt;full-name&gt;User 11&lt;/full-name&gt;
+    &lt;email&gt;user11@example.com&lt;/email&gt;
+  &lt;/record&gt;
+
+  &lt;record type=&quot;user&quot;&gt;
+    &lt;short-name&gt;user12&lt;/short-name&gt;
+    &lt;uid&gt;user12&lt;/uid&gt;
+    &lt;password&gt;user12&lt;/password&gt;
+    &lt;full-name&gt;User 12&lt;/full-name&gt;
+    &lt;email&gt;user12@example.com&lt;/email&gt;
+  &lt;/record&gt;
+
+  &lt;record type=&quot;user&quot;&gt;
+    &lt;short-name&gt;user13&lt;/short-name&gt;
+    &lt;uid&gt;user13&lt;/uid&gt;
+    &lt;password&gt;user13&lt;/password&gt;
+    &lt;full-name&gt;User 13&lt;/full-name&gt;
+    &lt;email&gt;user13@example.com&lt;/email&gt;
+  &lt;/record&gt;
+
+  &lt;record type=&quot;user&quot;&gt;
+    &lt;short-name&gt;user14&lt;/short-name&gt;
+    &lt;uid&gt;user14&lt;/uid&gt;
+    &lt;password&gt;user14&lt;/password&gt;
+    &lt;full-name&gt;User 14&lt;/full-name&gt;
+    &lt;email&gt;user14@example.com&lt;/email&gt;
+  &lt;/record&gt;
+
+  &lt;record type=&quot;user&quot;&gt;
+    &lt;short-name&gt;user15&lt;/short-name&gt;
+    &lt;uid&gt;user15&lt;/uid&gt;
+    &lt;password&gt;user15&lt;/password&gt;
+    &lt;full-name&gt;User 15&lt;/full-name&gt;
+    &lt;email&gt;user15@example.com&lt;/email&gt;
+  &lt;/record&gt;
+
+  &lt;record type=&quot;user&quot;&gt;
+    &lt;short-name&gt;user16&lt;/short-name&gt;
+    &lt;uid&gt;user16&lt;/uid&gt;
+    &lt;password&gt;user16&lt;/password&gt;
+    &lt;full-name&gt;User 16&lt;/full-name&gt;
+    &lt;email&gt;user16@example.com&lt;/email&gt;
+  &lt;/record&gt;
+
+  &lt;record type=&quot;user&quot;&gt;
+    &lt;short-name&gt;user17&lt;/short-name&gt;
+    &lt;uid&gt;user17&lt;/uid&gt;
+    &lt;password&gt;user17&lt;/password&gt;
+    &lt;full-name&gt;User 17&lt;/full-name&gt;
+    &lt;email&gt;user17@example.com&lt;/email&gt;
+  &lt;/record&gt;
+
+  &lt;record type=&quot;user&quot;&gt;
+    &lt;short-name&gt;user18&lt;/short-name&gt;
+    &lt;uid&gt;user18&lt;/uid&gt;
+    &lt;password&gt;user18&lt;/password&gt;
+    &lt;full-name&gt;User 18&lt;/full-name&gt;
+    &lt;email&gt;user18@example.com&lt;/email&gt;
+  &lt;/record&gt;
+
+  &lt;record type=&quot;user&quot;&gt;
+    &lt;short-name&gt;user19&lt;/short-name&gt;
+    &lt;uid&gt;user19&lt;/uid&gt;
+    &lt;password&gt;user19&lt;/password&gt;
+    &lt;full-name&gt;User 19&lt;/full-name&gt;
+    &lt;email&gt;user19@example.com&lt;/email&gt;
+  &lt;/record&gt;
+
+  &lt;record type=&quot;user&quot;&gt;
+    &lt;short-name&gt;user20&lt;/short-name&gt;
+    &lt;uid&gt;user20&lt;/uid&gt;
+    &lt;password&gt;user20&lt;/password&gt;
+    &lt;full-name&gt;User 20&lt;/full-name&gt;
+    &lt;email&gt;user20@example.com&lt;/email&gt;
+  &lt;/record&gt;
+
+  &lt;record type=&quot;user&quot;&gt;
+    &lt;short-name&gt;user21&lt;/short-name&gt;
+    &lt;uid&gt;user21&lt;/uid&gt;
+    &lt;password&gt;user21&lt;/password&gt;
+    &lt;full-name&gt;User 21&lt;/full-name&gt;
+    &lt;email&gt;user21@example.com&lt;/email&gt;
+  &lt;/record&gt;
+
+  &lt;record type=&quot;user&quot;&gt;
+    &lt;short-name&gt;user22&lt;/short-name&gt;
+    &lt;uid&gt;user22&lt;/uid&gt;
+    &lt;password&gt;user22&lt;/password&gt;
+    &lt;full-name&gt;User 22&lt;/full-name&gt;
+    &lt;email&gt;user22@example.com&lt;/email&gt;
+  &lt;/record&gt;
+
+  &lt;record type=&quot;user&quot;&gt;
+    &lt;short-name&gt;user23&lt;/short-name&gt;
+    &lt;uid&gt;user23&lt;/uid&gt;
+    &lt;password&gt;user23&lt;/password&gt;
+    &lt;full-name&gt;User 23&lt;/full-name&gt;
+    &lt;email&gt;user23@example.com&lt;/email&gt;
+  &lt;/record&gt;
+
+  &lt;record type=&quot;user&quot;&gt;
+    &lt;short-name&gt;user24&lt;/short-name&gt;
+    &lt;uid&gt;user24&lt;/uid&gt;
+    &lt;password&gt;user24&lt;/password&gt;
+    &lt;full-name&gt;User 24&lt;/full-name&gt;
+    &lt;email&gt;user24@example.com&lt;/email&gt;
+  &lt;/record&gt;
+
+  &lt;record type=&quot;user&quot;&gt;
+    &lt;short-name&gt;user25&lt;/short-name&gt;
+    &lt;uid&gt;user25&lt;/uid&gt;
+    &lt;password&gt;user25&lt;/password&gt;
+    &lt;full-name&gt;User 25&lt;/full-name&gt;
+    &lt;email&gt;user25@example.com&lt;/email&gt;
+  &lt;/record&gt;
+
+  &lt;record type=&quot;group&quot;&gt;
</ins><span class="cx">     &lt;uid&gt;group01&lt;/uid&gt;
</span><del>-    &lt;guid&gt;group01&lt;/guid&gt;
</del><ins>+    &lt;short-name&gt;group01&lt;/short-name&gt;
</ins><span class="cx">     &lt;password&gt;group01&lt;/password&gt;
</span><del>-    &lt;name&gt;Group 01&lt;/name&gt;
-    &lt;email-address&gt;group01@example.com&lt;/email-address&gt;
-    &lt;members&gt;
-      &lt;member type=&quot;users&quot;&gt;user01&lt;/member&gt;
-    &lt;/members&gt;
-  &lt;/group&gt;
-  &lt;group&gt;
</del><ins>+    &lt;full-name&gt;Group 01&lt;/full-name&gt;
+      &lt;member-uid type=&quot;users&quot;&gt;user01&lt;/member-uid&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;group&quot;&gt;
</ins><span class="cx">     &lt;uid&gt;group02&lt;/uid&gt;
</span><del>-    &lt;guid&gt;group02&lt;/guid&gt;
</del><ins>+    &lt;short-name&gt;group02&lt;/short-name&gt;
</ins><span class="cx">     &lt;password&gt;group02&lt;/password&gt;
</span><del>-    &lt;name&gt;Group 02&lt;/name&gt;
-    &lt;email-address&gt;group02@example.com&lt;/email-address&gt;
-    &lt;members&gt;
-      &lt;member type=&quot;users&quot;&gt;user06&lt;/member&gt;
-      &lt;member type=&quot;users&quot;&gt;user07&lt;/member&gt;
-    &lt;/members&gt;
-  &lt;/group&gt;
-  &lt;group&gt;
</del><ins>+    &lt;full-name&gt;Group 02&lt;/full-name&gt;
+      &lt;member-uid type=&quot;users&quot;&gt;user06&lt;/member-uid&gt;
+      &lt;member-uid type=&quot;users&quot;&gt;user07&lt;/member-uid&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;group&quot;&gt;
</ins><span class="cx">     &lt;uid&gt;group03&lt;/uid&gt;
</span><del>-    &lt;guid&gt;group03&lt;/guid&gt;
</del><ins>+    &lt;short-name&gt;group03&lt;/short-name&gt;
</ins><span class="cx">     &lt;password&gt;group03&lt;/password&gt;
</span><del>-    &lt;name&gt;Group 03&lt;/name&gt;
-    &lt;members&gt;
-      &lt;member type=&quot;users&quot;&gt;user08&lt;/member&gt;
-      &lt;member type=&quot;users&quot;&gt;user09&lt;/member&gt;
-    &lt;/members&gt;
-  &lt;/group&gt;
-  &lt;group&gt;
</del><ins>+    &lt;full-name&gt;Group 03&lt;/full-name&gt;
+      &lt;member-uid type=&quot;users&quot;&gt;user08&lt;/member-uid&gt;
+      &lt;member-uid type=&quot;users&quot;&gt;user09&lt;/member-uid&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;group&quot;&gt;
</ins><span class="cx">     &lt;uid&gt;group04&lt;/uid&gt;
</span><del>-    &lt;guid&gt;group04&lt;/guid&gt;
</del><ins>+    &lt;short-name&gt;group04&lt;/short-name&gt;
</ins><span class="cx">     &lt;password&gt;group04&lt;/password&gt;
</span><del>-    &lt;name&gt;Group 04&lt;/name&gt;
-    &lt;members&gt;
-      &lt;member type=&quot;groups&quot;&gt;group02&lt;/member&gt;
-      &lt;member type=&quot;groups&quot;&gt;group03&lt;/member&gt;
-      &lt;member type=&quot;users&quot;&gt;user10&lt;/member&gt;
-    &lt;/members&gt;
-  &lt;/group&gt;
-  &lt;group&gt; &lt;!-- delegategroup --&gt;
</del><ins>+    &lt;full-name&gt;Group 04&lt;/full-name&gt;
+      &lt;member-uid type=&quot;groups&quot;&gt;group02&lt;/member-uid&gt;
+      &lt;member-uid type=&quot;groups&quot;&gt;group03&lt;/member-uid&gt;
+      &lt;member-uid type=&quot;users&quot;&gt;user10&lt;/member-uid&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;group&quot;&gt; &lt;!-- delegategroup --&gt;
</ins><span class="cx">     &lt;uid&gt;group05&lt;/uid&gt;
</span><del>-    &lt;guid&gt;group05&lt;/guid&gt;
</del><ins>+    &lt;short-name&gt;group05&lt;/short-name&gt;
</ins><span class="cx">     &lt;password&gt;group05&lt;/password&gt;
</span><del>-    &lt;name&gt;Group 05&lt;/name&gt;
-    &lt;members&gt;
-      &lt;member type=&quot;groups&quot;&gt;group06&lt;/member&gt;
-      &lt;member type=&quot;users&quot;&gt;user20&lt;/member&gt;
-    &lt;/members&gt;
-  &lt;/group&gt;
-  &lt;group&gt; &lt;!-- delegatesubgroup --&gt;
</del><ins>+    &lt;full-name&gt;Group 05&lt;/full-name&gt;
+      &lt;member-uid type=&quot;groups&quot;&gt;group06&lt;/member-uid&gt;
+      &lt;member-uid type=&quot;users&quot;&gt;user20&lt;/member-uid&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;group&quot;&gt; &lt;!-- delegatesubgroup --&gt;
</ins><span class="cx">     &lt;uid&gt;group06&lt;/uid&gt;
</span><del>-    &lt;guid&gt;group06&lt;/guid&gt;
</del><ins>+    &lt;short-name&gt;group06&lt;/short-name&gt;
</ins><span class="cx">     &lt;password&gt;group06&lt;/password&gt;
</span><del>-    &lt;name&gt;Group 06&lt;/name&gt;
-    &lt;members&gt;
-      &lt;member type=&quot;users&quot;&gt;user21&lt;/member&gt;
-    &lt;/members&gt;
-  &lt;/group&gt;
-  &lt;group&gt; &lt;!-- readonlydelegategroup --&gt;
</del><ins>+    &lt;full-name&gt;Group 06&lt;/full-name&gt;
+      &lt;member-uid type=&quot;users&quot;&gt;user21&lt;/member-uid&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;group&quot;&gt; &lt;!-- readonlydelegategroup --&gt;
</ins><span class="cx">     &lt;uid&gt;group07&lt;/uid&gt;
</span><del>-    &lt;guid&gt;group07&lt;/guid&gt;
</del><ins>+    &lt;short-name&gt;group07&lt;/short-name&gt;
</ins><span class="cx">     &lt;password&gt;group07&lt;/password&gt;
</span><del>-    &lt;name&gt;Group 07&lt;/name&gt;
-    &lt;members&gt;
-      &lt;member type=&quot;users&quot;&gt;user22&lt;/member&gt;
-      &lt;member type=&quot;users&quot;&gt;user23&lt;/member&gt;
-      &lt;member type=&quot;users&quot;&gt;user24&lt;/member&gt;
-    &lt;/members&gt;
-  &lt;/group&gt;
-  &lt;group&gt;
</del><ins>+    &lt;full-name&gt;Group 07&lt;/full-name&gt;
+      &lt;member-uid type=&quot;users&quot;&gt;user22&lt;/member-uid&gt;
+      &lt;member-uid type=&quot;users&quot;&gt;user23&lt;/member-uid&gt;
+      &lt;member-uid type=&quot;users&quot;&gt;user24&lt;/member-uid&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;group&quot;&gt;
</ins><span class="cx">     &lt;uid&gt;disabledgroup&lt;/uid&gt;
</span><del>-    &lt;guid&gt;disabledgroup&lt;/guid&gt;
</del><ins>+    &lt;short-name&gt;disabledgroup&lt;/short-name&gt;
</ins><span class="cx">     &lt;password&gt;disabledgroup&lt;/password&gt;
</span><del>-    &lt;name&gt;Disabled Group&lt;/name&gt;
-    &lt;members&gt;
-      &lt;member type=&quot;users&quot;&gt;user01&lt;/member&gt;
-    &lt;/members&gt;
-  &lt;/group&gt;
-&lt;/accounts&gt;
</del><ins>+    &lt;full-name&gt;Disabled Group&lt;/full-name&gt;
+      &lt;member-uid type=&quot;users&quot;&gt;user01&lt;/member-uid&gt;
+  &lt;/record&gt;
+&lt;/directory&gt;
</ins></span></pre></div>
<a id="CalendarServerbranchesuserssagenmove2who2txdavwhotestaccountsaugmentsxml"></a>
<div class="addfile"><h4>Added: CalendarServer/branches/users/sagen/move2who-2/txdav/who/test/accounts/augments.xml (0 => 12897)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-2/txdav/who/test/accounts/augments.xml                                (rev 0)
+++ CalendarServer/branches/users/sagen/move2who-2/txdav/who/test/accounts/augments.xml        2014-03-13 20:33:25 UTC (rev 12897)
</span><span class="lines">@@ -0,0 +1,185 @@
</span><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
+&lt;!DOCTYPE augments SYSTEM &quot;augments.dtd&quot;&gt;
+
+&lt;augments&gt;
+  &lt;record&gt;
+    &lt;uid&gt;Default&lt;/uid&gt;
+    &lt;enable&gt;true&lt;/enable&gt;
+    &lt;enable-calendar&gt;true&lt;/enable-calendar&gt;
+    &lt;enable-addressbook&gt;true&lt;/enable-addressbook&gt;
+  &lt;/record&gt;
+  &lt;record repeat=&quot;10&quot;&gt;
+    &lt;uid&gt;location%02d&lt;/uid&gt;
+    &lt;enable&gt;true&lt;/enable&gt;
+    &lt;enable-calendar&gt;true&lt;/enable-calendar&gt;
+    &lt;enable-addressbook&gt;true&lt;/enable-addressbook&gt;
+    &lt;auto-schedule&gt;true&lt;/auto-schedule&gt;
+  &lt;/record&gt;
+  &lt;record repeat=&quot;4&quot;&gt;
+    &lt;uid&gt;resource%02d&lt;/uid&gt;
+    &lt;enable&gt;true&lt;/enable&gt;
+    &lt;enable-calendar&gt;true&lt;/enable-calendar&gt;
+    &lt;enable-addressbook&gt;true&lt;/enable-addressbook&gt;
+    &lt;auto-schedule&gt;true&lt;/auto-schedule&gt;
+  &lt;/record&gt;
+  &lt;record&gt;
+    &lt;uid&gt;resource05&lt;/uid&gt;
+    &lt;enable&gt;true&lt;/enable&gt;
+    &lt;enable-calendar&gt;true&lt;/enable-calendar&gt;
+    &lt;enable-addressbook&gt;true&lt;/enable-addressbook&gt;
+    &lt;auto-schedule&gt;true&lt;/auto-schedule&gt;
+    &lt;auto-schedule-mode&gt;none&lt;/auto-schedule-mode&gt;
+  &lt;/record&gt;
+  &lt;record&gt;
+    &lt;uid&gt;resource06&lt;/uid&gt;
+    &lt;enable&gt;true&lt;/enable&gt;
+    &lt;enable-calendar&gt;true&lt;/enable-calendar&gt;
+    &lt;enable-addressbook&gt;true&lt;/enable-addressbook&gt;
+    &lt;auto-schedule&gt;true&lt;/auto-schedule&gt;
+    &lt;auto-schedule-mode&gt;accept-always&lt;/auto-schedule-mode&gt;
+  &lt;/record&gt;
+  &lt;record&gt;
+    &lt;uid&gt;resource07&lt;/uid&gt;
+    &lt;enable&gt;true&lt;/enable&gt;
+    &lt;enable-calendar&gt;true&lt;/enable-calendar&gt;
+    &lt;enable-addressbook&gt;true&lt;/enable-addressbook&gt;
+    &lt;auto-schedule&gt;true&lt;/auto-schedule&gt;
+    &lt;auto-schedule-mode&gt;decline-always&lt;/auto-schedule-mode&gt;
+  &lt;/record&gt;
+  &lt;record&gt;
+    &lt;uid&gt;resource08&lt;/uid&gt;
+    &lt;enable&gt;true&lt;/enable&gt;
+    &lt;enable-calendar&gt;true&lt;/enable-calendar&gt;
+    &lt;enable-addressbook&gt;true&lt;/enable-addressbook&gt;
+    &lt;auto-schedule&gt;true&lt;/auto-schedule&gt;
+    &lt;auto-schedule-mode&gt;accept-if-free&lt;/auto-schedule-mode&gt;
+  &lt;/record&gt;
+  &lt;record&gt;
+    &lt;uid&gt;resource09&lt;/uid&gt;
+    &lt;enable&gt;true&lt;/enable&gt;
+    &lt;enable-calendar&gt;true&lt;/enable-calendar&gt;
+    &lt;enable-addressbook&gt;true&lt;/enable-addressbook&gt;
+    &lt;auto-schedule&gt;true&lt;/auto-schedule&gt;
+    &lt;auto-schedule-mode&gt;decline-if-busy&lt;/auto-schedule-mode&gt;
+  &lt;/record&gt;
+  &lt;record&gt;
+    &lt;uid&gt;resource10&lt;/uid&gt;
+    &lt;enable&gt;true&lt;/enable&gt;
+    &lt;enable-calendar&gt;true&lt;/enable-calendar&gt;
+    &lt;enable-addressbook&gt;true&lt;/enable-addressbook&gt;
+    &lt;auto-schedule&gt;true&lt;/auto-schedule&gt;
+    &lt;auto-schedule-mode&gt;automatic&lt;/auto-schedule-mode&gt;
+  &lt;/record&gt;
+  &lt;record&gt;
+    &lt;uid&gt;resource11&lt;/uid&gt;
+    &lt;enable&gt;true&lt;/enable&gt;
+    &lt;enable-calendar&gt;true&lt;/enable-calendar&gt;
+    &lt;enable-addressbook&gt;true&lt;/enable-addressbook&gt;
+    &lt;auto-schedule&gt;true&lt;/auto-schedule&gt;
+    &lt;auto-schedule-mode&gt;decline-always&lt;/auto-schedule-mode&gt;
+    &lt;auto-accept-group&gt;group01&lt;/auto-accept-group&gt;
+  &lt;/record&gt;
+  &lt;record repeat=&quot;10&quot;&gt;
+    &lt;uid&gt;group%02d&lt;/uid&gt;
+    &lt;enable&gt;true&lt;/enable&gt;
+  &lt;/record&gt;
+  &lt;record&gt;
+    &lt;uid&gt;disabledgroup&lt;/uid&gt;
+    &lt;enable&gt;false&lt;/enable&gt;
+  &lt;/record&gt;
+  &lt;record&gt;
+    &lt;uid&gt;delegatedroom&lt;/uid&gt;
+    &lt;enable&gt;true&lt;/enable&gt;
+    &lt;enable-calendar&gt;true&lt;/enable-calendar&gt;
+    &lt;enable-addressbook&gt;false&lt;/enable-addressbook&gt;
+    &lt;auto-schedule&gt;false&lt;/auto-schedule&gt;
+  &lt;/record&gt;
+  &lt;record&gt;
+    &lt;uid&gt;03DFF660-8BCC-4198-8588-DD77F776F518&lt;/uid&gt;
+    &lt;enable&gt;true&lt;/enable&gt;
+    &lt;enable-calendar&gt;true&lt;/enable-calendar&gt;
+    &lt;enable-addressbook&gt;true&lt;/enable-addressbook&gt;
+    &lt;enable-login&gt;true&lt;/enable-login&gt;
+    &lt;auto-schedule&gt;true&lt;/auto-schedule&gt;
+  &lt;/record&gt;
+  &lt;record&gt;
+    &lt;uid&gt;80689D41-DAF8-4189-909C-DB017B271892&lt;/uid&gt;
+    &lt;enable&gt;true&lt;/enable&gt;
+    &lt;enable-calendar&gt;true&lt;/enable-calendar&gt;
+    &lt;enable-addressbook&gt;true&lt;/enable-addressbook&gt;
+    &lt;enable-login&gt;true&lt;/enable-login&gt;
+    &lt;auto-schedule&gt;true&lt;/auto-schedule&gt;
+    &lt;auto-schedule-mode&gt;default&lt;/auto-schedule-mode&gt;
+  &lt;/record&gt;
+  &lt;record&gt;
+    &lt;uid&gt;C38BEE7A-36EE-478C-9DCB-CBF4612AFE65&lt;/uid&gt;
+    &lt;enable&gt;true&lt;/enable&gt;
+    &lt;enable-calendar&gt;true&lt;/enable-calendar&gt;
+    &lt;enable-addressbook&gt;true&lt;/enable-addressbook&gt;
+    &lt;enable-login&gt;true&lt;/enable-login&gt;
+    &lt;auto-schedule&gt;true&lt;/auto-schedule&gt;
+    &lt;auto-schedule-mode&gt;default&lt;/auto-schedule-mode&gt;
+    &lt;auto-accept-group&gt;group01&lt;/auto-accept-group&gt;
+  &lt;/record&gt;
+  &lt;record&gt;
+    &lt;uid&gt;CCE95217-A57B-481A-AC3D-FEC9AB6CE3A9&lt;/uid&gt;
+    &lt;enable&gt;true&lt;/enable&gt;
+    &lt;enable-calendar&gt;true&lt;/enable-calendar&gt;
+    &lt;enable-addressbook&gt;true&lt;/enable-addressbook&gt;
+    &lt;enable-login&gt;true&lt;/enable-login&gt;
+    &lt;auto-schedule&gt;true&lt;/auto-schedule&gt;
+  &lt;/record&gt;
+  &lt;record&gt;
+    &lt;uid&gt;0CE0BF31-5F9E-4801-A489-8C70CF287F5F&lt;/uid&gt;
+    &lt;enable&gt;true&lt;/enable&gt;
+    &lt;enable-calendar&gt;true&lt;/enable-calendar&gt;
+    &lt;enable-addressbook&gt;true&lt;/enable-addressbook&gt;
+    &lt;enable-login&gt;true&lt;/enable-login&gt;
+    &lt;auto-schedule&gt;true&lt;/auto-schedule&gt;
+  &lt;/record&gt;
+  &lt;record&gt;
+    &lt;uid&gt;6F9EE33B-78F6-481B-9289-3D0812FF0D64&lt;/uid&gt;
+    &lt;enable&gt;true&lt;/enable&gt;
+    &lt;enable-calendar&gt;true&lt;/enable-calendar&gt;
+    &lt;enable-addressbook&gt;true&lt;/enable-addressbook&gt;
+    &lt;enable-login&gt;true&lt;/enable-login&gt;
+    &lt;auto-schedule&gt;false&lt;/auto-schedule&gt;
+    &lt;auto-schedule-mode&gt;default&lt;/auto-schedule-mode&gt;
+  &lt;/record&gt;
+  &lt;record&gt;
+    &lt;uid&gt;76E7ECA6-08BC-4AE7-930D-F2E7453993A5&lt;/uid&gt;
+    &lt;enable&gt;true&lt;/enable&gt;
+    &lt;enable-calendar&gt;true&lt;/enable-calendar&gt;
+    &lt;enable-addressbook&gt;true&lt;/enable-addressbook&gt;
+    &lt;enable-login&gt;true&lt;/enable-login&gt;
+    &lt;auto-schedule&gt;false&lt;/auto-schedule&gt;
+    &lt;auto-schedule-mode&gt;default&lt;/auto-schedule-mode&gt;
+  &lt;/record&gt;
+  &lt;record&gt;
+    &lt;uid&gt;63A2F949-2D8D-4C8D-B8A5-DCF2A94610F3&lt;/uid&gt;
+    &lt;enable&gt;true&lt;/enable&gt;
+    &lt;enable-calendar&gt;true&lt;/enable-calendar&gt;
+    &lt;enable-addressbook&gt;true&lt;/enable-addressbook&gt;
+    &lt;enable-login&gt;true&lt;/enable-login&gt;
+    &lt;auto-schedule&gt;false&lt;/auto-schedule&gt;
+    &lt;auto-schedule-mode&gt;default&lt;/auto-schedule-mode&gt;
+  &lt;/record&gt;
+  &lt;record&gt;
+    &lt;uid&gt;06E3BDCB-9C19-485A-B14E-F146A80ADDC6&lt;/uid&gt;
+    &lt;enable&gt;true&lt;/enable&gt;
+    &lt;enable-calendar&gt;true&lt;/enable-calendar&gt;
+    &lt;enable-addressbook&gt;true&lt;/enable-addressbook&gt;
+    &lt;enable-login&gt;true&lt;/enable-login&gt;
+    &lt;auto-schedule&gt;true&lt;/auto-schedule&gt;
+    &lt;auto-schedule-mode&gt;default&lt;/auto-schedule-mode&gt;
+  &lt;/record&gt;
+  &lt;record&gt;
+    &lt;uid&gt;4D66A20A-1437-437D-8069-2F14E8322234&lt;/uid&gt;
+    &lt;enable&gt;true&lt;/enable&gt;
+    &lt;enable-calendar&gt;true&lt;/enable-calendar&gt;
+    &lt;enable-addressbook&gt;true&lt;/enable-addressbook&gt;
+    &lt;enable-login&gt;true&lt;/enable-login&gt;
+    &lt;auto-schedule&gt;true&lt;/auto-schedule&gt;
+    &lt;auto-schedule-mode&gt;default&lt;/auto-schedule-mode&gt;
+  &lt;/record&gt;
+&lt;/augments&gt;
</ins></span></pre></div>
<a id="CalendarServerbranchesuserssagenmove2who2txdavwhotestaccountsresourcesxml"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-2/txdav/who/test/accounts/resources.xml (12896 => 12897)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-2/txdav/who/test/accounts/resources.xml        2014-03-13 19:14:42 UTC (rev 12896)
+++ CalendarServer/branches/users/sagen/move2who-2/txdav/who/test/accounts/resources.xml        2014-03-13 20:33:25 UTC (rev 12897)
</span><span class="lines">@@ -1,34 +1,273 @@
</span><del>-&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
-
-&lt;!--
-Copyright (c) 2006-2014 Apple Inc. All rights reserved.
-
-Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
- --&gt;
-
-&lt;!DOCTYPE accounts SYSTEM &quot;accounts.dtd&quot;&gt;
-
-&lt;accounts realm=&quot;Test Realm&quot;&gt;
-  &lt;location repeat=&quot;10&quot;&gt;
-    &lt;uid&gt;location%02d&lt;/uid&gt;
-    &lt;guid&gt;location%02d&lt;/guid&gt;
-    &lt;password&gt;location%02d&lt;/password&gt;
-    &lt;name&gt;Room %02d&lt;/name&gt;
-  &lt;/location&gt;
-  &lt;resource repeat=&quot;10&quot;&gt;
-    &lt;uid&gt;resource%02d&lt;/uid&gt;
-    &lt;guid&gt;resource%02d&lt;/guid&gt;
-    &lt;password&gt;resource%02d&lt;/password&gt;
-    &lt;name&gt;Resource %02d&lt;/name&gt;
-  &lt;/resource&gt;
-&lt;/accounts&gt;
</del><ins>+&lt;directory realm=&quot;Test Realm&quot;&gt;
+  &lt;record type=&quot;location&quot;&gt;
+    &lt;short-name&gt;fantastic&lt;/short-name&gt;
+    &lt;uid&gt;4D66A20A-1437-437D-8069-2F14E8322234&lt;/uid&gt;
+    &lt;full-name&gt;Fantastic Conference Room&lt;/full-name&gt;
+    &lt;extras&gt;
+      &lt;associatedAddress&gt;63A2F949-2D8D-4C8D-B8A5-DCF2A94610F3&lt;/associatedAddress&gt;
+    &lt;/extras&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;location&quot;&gt;
+    &lt;short-name&gt;jupiter&lt;/short-name&gt;
+    &lt;uid&gt;jupiter&lt;/uid&gt;
+    &lt;full-name&gt;Jupiter Conference Room, Building 2, 1st Floor&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;location&quot;&gt;
+    &lt;short-name&gt;uranus&lt;/short-name&gt;
+    &lt;uid&gt;uranus&lt;/uid&gt;
+    &lt;full-name&gt;Uranus Conference Room, Building 3, 1st Floor&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;location&quot;&gt;
+    &lt;short-name&gt;morgensroom&lt;/short-name&gt;
+    &lt;uid&gt;03DFF660-8BCC-4198-8588-DD77F776F518&lt;/uid&gt;
+    &lt;full-name&gt;Morgen's Room&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;location&quot;&gt;
+    &lt;short-name&gt;mercury&lt;/short-name&gt;
+    &lt;uid&gt;mercury&lt;/uid&gt;
+    &lt;full-name&gt;Mercury Conference Room, Building 1, 2nd Floor&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;location&quot;&gt;
+    &lt;short-name&gt;location09&lt;/short-name&gt;
+    &lt;uid&gt;location09&lt;/uid&gt;
+    &lt;full-name&gt;Room 09&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;location&quot;&gt;
+    &lt;short-name&gt;location08&lt;/short-name&gt;
+    &lt;uid&gt;location08&lt;/uid&gt;
+    &lt;full-name&gt;Room 08&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;location&quot;&gt;
+    &lt;short-name&gt;location07&lt;/short-name&gt;
+    &lt;uid&gt;location07&lt;/uid&gt;
+    &lt;full-name&gt;Room 07&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;location&quot;&gt;
+    &lt;short-name&gt;location06&lt;/short-name&gt;
+    &lt;uid&gt;location06&lt;/uid&gt;
+    &lt;full-name&gt;Room 06&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;location&quot;&gt;
+    &lt;short-name&gt;location05&lt;/short-name&gt;
+    &lt;uid&gt;location05&lt;/uid&gt;
+    &lt;full-name&gt;Room 05&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;location&quot;&gt;
+    &lt;short-name&gt;location04&lt;/short-name&gt;
+    &lt;uid&gt;location04&lt;/uid&gt;
+    &lt;full-name&gt;Room 04&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;location&quot;&gt;
+    &lt;short-name&gt;location03&lt;/short-name&gt;
+    &lt;uid&gt;location03&lt;/uid&gt;
+    &lt;full-name&gt;Room 03&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;location&quot;&gt;
+    &lt;short-name&gt;location02&lt;/short-name&gt;
+    &lt;uid&gt;location02&lt;/uid&gt;
+    &lt;full-name&gt;Room 02&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;location&quot;&gt;
+    &lt;short-name&gt;location01&lt;/short-name&gt;
+    &lt;uid&gt;location01&lt;/uid&gt;
+    &lt;full-name&gt;Room 01&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;location&quot;&gt;
+    &lt;short-name&gt;delegatedroom&lt;/short-name&gt;
+    &lt;uid&gt;delegatedroom&lt;/uid&gt;
+    &lt;full-name&gt;Delegated Conference Room&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;location&quot;&gt;
+    &lt;short-name&gt;mars&lt;/short-name&gt;
+    &lt;uid&gt;redplanet&lt;/uid&gt;
+    &lt;full-name&gt;Mars Conference Room, Building 1, 1st Floor&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;location&quot;&gt;
+    &lt;short-name&gt;sharissroom&lt;/short-name&gt;
+    &lt;uid&gt;80689D41-DAF8-4189-909C-DB017B271892&lt;/uid&gt;
+    &lt;full-name&gt;Shari's Room&lt;/full-name&gt;
+    &lt;extras&gt;
+      &lt;associatedAddress&gt;6F9EE33B-78F6-481B-9289-3D0812FF0D64&lt;/associatedAddress&gt;
+    &lt;/extras&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;location&quot;&gt;
+    &lt;short-name&gt;pluto&lt;/short-name&gt;
+    &lt;uid&gt;pluto&lt;/uid&gt;
+    &lt;full-name&gt;Pluto Conference Room, Building 2, 1st Floor&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;location&quot;&gt;
+    &lt;short-name&gt;saturn&lt;/short-name&gt;
+    &lt;uid&gt;saturn&lt;/uid&gt;
+    &lt;full-name&gt;Saturn Conference Room, Building 2, 1st Floor&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;location&quot;&gt;
+    &lt;short-name&gt;location10&lt;/short-name&gt;
+    &lt;uid&gt;location10&lt;/uid&gt;
+    &lt;full-name&gt;Room 10&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;location&quot;&gt;
+    &lt;short-name&gt;pretend&lt;/short-name&gt;
+    &lt;uid&gt;06E3BDCB-9C19-485A-B14E-F146A80ADDC6&lt;/uid&gt;
+    &lt;full-name&gt;Pretend Conference Room&lt;/full-name&gt;
+    &lt;extras&gt;
+      &lt;associatedAddress&gt;76E7ECA6-08BC-4AE7-930D-F2E7453993A5&lt;/associatedAddress&gt;
+    &lt;/extras&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;location&quot;&gt;
+    &lt;short-name&gt;neptune&lt;/short-name&gt;
+    &lt;uid&gt;neptune&lt;/uid&gt;
+    &lt;full-name&gt;Neptune Conference Room, Building 2, 1st Floor&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;location&quot;&gt;
+    &lt;short-name&gt;Earth&lt;/short-name&gt;
+    &lt;uid&gt;Earth&lt;/uid&gt;
+    &lt;full-name&gt;Earth Conference Room, Building 1, 1st Floor&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;location&quot;&gt;
+    &lt;short-name&gt;venus&lt;/short-name&gt;
+    &lt;uid&gt;venus&lt;/uid&gt;
+    &lt;full-name&gt;Venus Conference Room, Building 1, 2nd Floor&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;resource&quot;&gt;
+    &lt;short-name&gt;sharisotherresource&lt;/short-name&gt;
+    &lt;uid&gt;CCE95217-A57B-481A-AC3D-FEC9AB6CE3A9&lt;/uid&gt;
+    &lt;full-name&gt;Shari's Other Resource&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;resource&quot;&gt;
+    &lt;short-name&gt;resource15&lt;/short-name&gt;
+    &lt;uid&gt;resource15&lt;/uid&gt;
+    &lt;full-name&gt;Resource 15&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;resource&quot;&gt;
+    &lt;short-name&gt;resource14&lt;/short-name&gt;
+    &lt;uid&gt;resource14&lt;/uid&gt;
+    &lt;full-name&gt;Resource 14&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;resource&quot;&gt;
+    &lt;short-name&gt;resource17&lt;/short-name&gt;
+    &lt;uid&gt;resource17&lt;/uid&gt;
+    &lt;full-name&gt;Resource 17&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;resource&quot;&gt;
+    &lt;short-name&gt;resource16&lt;/short-name&gt;
+    &lt;uid&gt;resource16&lt;/uid&gt;
+    &lt;full-name&gt;Resource 16&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;resource&quot;&gt;
+    &lt;short-name&gt;resource11&lt;/short-name&gt;
+    &lt;uid&gt;resource11&lt;/uid&gt;
+    &lt;full-name&gt;Resource 11&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;resource&quot;&gt;
+    &lt;short-name&gt;resource10&lt;/short-name&gt;
+    &lt;uid&gt;resource10&lt;/uid&gt;
+    &lt;full-name&gt;Resource 10&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;resource&quot;&gt;
+    &lt;short-name&gt;resource13&lt;/short-name&gt;
+    &lt;uid&gt;resource13&lt;/uid&gt;
+    &lt;full-name&gt;Resource 13&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;resource&quot;&gt;
+    &lt;short-name&gt;resource12&lt;/short-name&gt;
+    &lt;uid&gt;resource12&lt;/uid&gt;
+    &lt;full-name&gt;Resource 12&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;resource&quot;&gt;
+    &lt;short-name&gt;resource19&lt;/short-name&gt;
+    &lt;uid&gt;resource19&lt;/uid&gt;
+    &lt;full-name&gt;Resource 19&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;resource&quot;&gt;
+    &lt;short-name&gt;resource18&lt;/short-name&gt;
+    &lt;uid&gt;resource18&lt;/uid&gt;
+    &lt;full-name&gt;Resource 18&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;resource&quot;&gt;
+    &lt;short-name&gt;sharisresource&lt;/short-name&gt;
+    &lt;uid&gt;C38BEE7A-36EE-478C-9DCB-CBF4612AFE65&lt;/uid&gt;
+    &lt;full-name&gt;Shari's Resource&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;resource&quot;&gt;
+    &lt;short-name&gt;resource20&lt;/short-name&gt;
+    &lt;uid&gt;resource20&lt;/uid&gt;
+    &lt;full-name&gt;Resource 20&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;resource&quot;&gt;
+    &lt;short-name&gt;resource06&lt;/short-name&gt;
+    &lt;uid&gt;resource06&lt;/uid&gt;
+    &lt;full-name&gt;Resource 06&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;resource&quot;&gt;
+    &lt;short-name&gt;resource07&lt;/short-name&gt;
+    &lt;uid&gt;resource07&lt;/uid&gt;
+    &lt;full-name&gt;Resource 07&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;resource&quot;&gt;
+    &lt;short-name&gt;resource04&lt;/short-name&gt;
+    &lt;uid&gt;resource04&lt;/uid&gt;
+    &lt;full-name&gt;Resource 04&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;resource&quot;&gt;
+    &lt;short-name&gt;resource05&lt;/short-name&gt;
+    &lt;uid&gt;resource05&lt;/uid&gt;
+    &lt;full-name&gt;Resource 05&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;resource&quot;&gt;
+    &lt;short-name&gt;resource02&lt;/short-name&gt;
+    &lt;uid&gt;resource02&lt;/uid&gt;
+    &lt;full-name&gt;Resource 02&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;resource&quot;&gt;
+    &lt;short-name&gt;resource03&lt;/short-name&gt;
+    &lt;uid&gt;resource03&lt;/uid&gt;
+    &lt;full-name&gt;Resource 03&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;resource&quot;&gt;
+    &lt;short-name&gt;resource01&lt;/short-name&gt;
+    &lt;uid&gt;resource01&lt;/uid&gt;
+    &lt;full-name&gt;Resource 01&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;resource&quot;&gt;
+    &lt;short-name&gt;sharisotherresource1&lt;/short-name&gt;
+    &lt;uid&gt;0CE0BF31-5F9E-4801-A489-8C70CF287F5F&lt;/uid&gt;
+    &lt;full-name&gt;Shari's Other Resource1&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;resource&quot;&gt;
+    &lt;short-name&gt;resource08&lt;/short-name&gt;
+    &lt;uid&gt;resource08&lt;/uid&gt;
+    &lt;full-name&gt;Resource 08&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;resource&quot;&gt;
+    &lt;short-name&gt;resource09&lt;/short-name&gt;
+    &lt;uid&gt;resource09&lt;/uid&gt;
+    &lt;full-name&gt;Resource 09&lt;/full-name&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;address&quot;&gt;
+    &lt;short-name&gt;testaddress1&lt;/short-name&gt;
+    &lt;uid&gt;6F9EE33B-78F6-481B-9289-3D0812FF0D64&lt;/uid&gt;
+    &lt;full-name&gt;Test Address One&lt;/full-name&gt;
+    &lt;extras&gt;
+      &lt;streetAddress&gt;20300 Stevens Creek Blvd, Cupertino, CA 95014&lt;/streetAddress&gt;
+      &lt;geo&gt;37.322281,-122.028345&lt;/geo&gt;
+    &lt;/extras&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;address&quot;&gt;
+    &lt;short-name&gt;il2&lt;/short-name&gt;
+    &lt;uid&gt;63A2F949-2D8D-4C8D-B8A5-DCF2A94610F3&lt;/uid&gt;
+    &lt;full-name&gt;IL2&lt;/full-name&gt;
+    &lt;extras&gt;
+      &lt;streetAddress&gt;2 Infinite Loop, Cupertino, CA 95014&lt;/streetAddress&gt;
+      &lt;geo&gt;37.332633,-122.030502&lt;/geo&gt;
+    &lt;/extras&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;address&quot;&gt;
+    &lt;short-name&gt;il1&lt;/short-name&gt;
+    &lt;uid&gt;76E7ECA6-08BC-4AE7-930D-F2E7453993A5&lt;/uid&gt;
+    &lt;full-name&gt;IL1&lt;/full-name&gt;
+    &lt;extras&gt;
+      &lt;streetAddress&gt;1 Infinite Loop, Cupertino, CA 95014&lt;/streetAddress&gt;
+      &lt;geo&gt;37.331741,-122.030333&lt;/geo&gt;
+    &lt;/extras&gt;
+  &lt;/record&gt;
+&lt;/directory&gt;
</ins></span></pre></div>
<a id="CalendarServerbranchesuserssagenmove2who2txdavwhotesttest_utilpy"></a>
<div class="addfile"><h4>Added: CalendarServer/branches/users/sagen/move2who-2/txdav/who/test/test_util.py (0 => 12897)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-2/txdav/who/test/test_util.py                                (rev 0)
+++ CalendarServer/branches/users/sagen/move2who-2/txdav/who/test/test_util.py        2014-03-13 20:33:25 UTC (rev 12897)
</span><span class="lines">@@ -0,0 +1,96 @@
</span><ins>+##
+# Copyright (c) 2013 Apple Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##
+
+&quot;&quot;&quot;
+txdav.who.util tests
+&quot;&quot;&quot;
+
+import os
+
+from txdav.who.util import directoryFromConfig
+from twisted.trial.unittest import TestCase
+from twistedcaldav.config import ConfigDict
+from twisted.python.filepath import FilePath
+from txdav.who.augment import AugmentedDirectoryService
+from twext.who.aggregate import DirectoryService as AggregateDirectoryService
+
+
+class StubStore(object):
+    pass
+
+
+
+class UtilTest(TestCase):
+
+    def setUp(self):
+        sourceDir = FilePath(__file__).parent().child(&quot;accounts&quot;)
+        self.serverRoot = os.path.abspath(self.mktemp())
+        os.mkdir(self.serverRoot)
+        self.dataRoot = os.path.join(self.serverRoot, &quot;data&quot;)
+        if not os.path.exists(self.dataRoot):
+            os.makedirs(self.dataRoot)
+        destDir = FilePath(self.dataRoot)
+
+        accounts = destDir.child(&quot;accounts.xml&quot;)
+        sourceAccounts = sourceDir.child(&quot;accounts.xml&quot;)
+        accounts.setContent(sourceAccounts.getContent())
+
+        resources = destDir.child(&quot;resources.xml&quot;)
+        sourceResources = sourceDir.child(&quot;resources.xml&quot;)
+        resources.setContent(sourceResources.getContent())
+
+        augments = destDir.child(&quot;augments.xml&quot;)
+        sourceAugments = sourceDir.child(&quot;augments.xml&quot;)
+        augments.setContent(sourceAugments.getContent())
+
+
+    def test_directoryFromConfig(self):
+
+        config = ConfigDict(
+            {
+                &quot;DataRoot&quot;: self.dataRoot,
+                &quot;DirectoryService&quot;: {
+                    &quot;Enabled&quot;: True,
+                    &quot;type&quot;: &quot;XML&quot;,
+                    &quot;params&quot;: {
+                        &quot;xmlFile&quot;: &quot;accounts.xml&quot;,
+                        &quot;recordTypes&quot;: [&quot;users&quot;, &quot;groups&quot;],
+                    },
+                },
+                &quot;ResourceService&quot;: {
+                    &quot;Enabled&quot;: True,
+                    &quot;type&quot;: &quot;XML&quot;,
+                    &quot;params&quot;: {
+                        &quot;xmlFile&quot;: &quot;resources.xml&quot;,
+                        &quot;recordTypes&quot;: [&quot;locations&quot;, &quot;resources&quot;],
+                    },
+                },
+                &quot;AugmentService&quot;: {
+                    &quot;Enabled&quot;: True,
+                    # FIXME: This still uses an actual class name:
+                    &quot;type&quot;: &quot;twistedcaldav.directory.augment.AugmentXMLDB&quot;,
+                    &quot;params&quot;: {
+                        &quot;xmlFiles&quot;: [&quot;augments.xml&quot;],
+                    },
+                },
+            }
+        )
+
+        store = StubStore()
+        service = directoryFromConfig(config, store=store)
+        self.assertTrue(isinstance(service, AugmentedDirectoryService))
+        self.assertTrue(isinstance(service._directory, AggregateDirectoryService))
+        self.assertEquals(len(service._directory.services), 3)
</ins></span></pre></div>
<a id="CalendarServerbranchesuserssagenmove2who2txdavwhoutilpy"></a>
<div class="addfile"><h4>Added: CalendarServer/branches/users/sagen/move2who-2/txdav/who/util.py (0 => 12897)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-2/txdav/who/util.py                                (rev 0)
+++ CalendarServer/branches/users/sagen/move2who-2/txdav/who/util.py        2014-03-13 20:33:25 UTC (rev 12897)
</span><span class="lines">@@ -0,0 +1,162 @@
</span><ins>+##
+# Copyright (c) 2006-2014 Apple Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##
+
+
+import os
+from twext.python.log import Logger
+from twisted.cred.credentials import UsernamePassword
+from twext.who.aggregate import DirectoryService as AggregateDirectoryService
+from txdav.who.augment import AugmentedDirectoryService
+
+from calendarserver.tap.util import getDBPool, storeFromConfig
+from twext.who.idirectory import RecordType, DirectoryConfigurationError
+from twext.who.ldap import DirectoryService as LDAPDirectoryService
+from twext.who.util import ConstantsContainer
+from twisted.python.filepath import FilePath
+from twisted.python.reflect import namedClass
+from twistedcaldav.config import fullServerPath
+from txdav.who.delegates import DirectoryService as DelegateDirectoryService
+from txdav.who.idirectory import RecordType as CalRecordType
+from txdav.who.xml import DirectoryService as XMLDirectoryService
+
+log = Logger()
+
+
+def directoryFromConfig(config, store=None):
+    &quot;&quot;&quot;
+    Return a directory service based on the config.  If you want to go through
+    AMP to talk to one of these as a client, instantiate
+    txdav.dps.client.DirectoryService
+    &quot;&quot;&quot;
+
+    # MOVE2WHO FIXME: this needs to talk to its own separate database.  In fact,
+    # don't pass store=None if you already have called storeFromConfig()
+    # within this process.  Pass the existing store in here.
+    if store is None:
+        pool, txnFactory = getDBPool(config)
+        store = storeFromConfig(config, txnFactory, None)
+
+    aggregatedServices = []
+
+
+    for serviceKey in (&quot;DirectoryService&quot;, &quot;ResourceService&quot;):
+        serviceValue = config.get(serviceKey, None)
+
+        if not serviceValue.Enabled:
+            continue
+
+        directoryType = serviceValue.type.lower()
+        params = serviceValue.params
+
+        if &quot;xml&quot; in directoryType:
+            xmlFile = params.xmlFile
+            xmlFile = fullServerPath(config.DataRoot, xmlFile)
+            if not xmlFile or not os.path.exists(xmlFile):
+                log.error(&quot;Path not found for XML directory: {p}&quot;, p=xmlFile)
+            fp = FilePath(xmlFile)
+            directory = XMLDirectoryService(fp)
+
+        elif &quot;opendirectory&quot; in directoryType:
+            from twext.who.opendirectory import DirectoryService as ODDirectoryService
+            directory = ODDirectoryService()
+
+        elif &quot;ldap&quot; in directoryType:
+            if params.credentials.dn and params.credentials.password:
+                creds = UsernamePassword(params.credentials.dn,
+                                         params.credentials.password)
+            else:
+                creds = None
+            directory = LDAPDirectoryService(
+                params.uri,
+                params.rdnSchema.base,
+                creds=creds
+            )
+
+        else:
+            log.error(&quot;Invalid DirectoryType: {dt}&quot;, dt=directoryType)
+            raise DirectoryConfigurationError
+
+        # Set the appropriate record types on each service
+        types = []
+        for recordTypeName in params.recordTypes:
+            recordType = {
+                &quot;users&quot;: RecordType.user,
+                &quot;groups&quot;: RecordType.group,
+                &quot;locations&quot;: CalRecordType.location,
+                &quot;resources&quot;: CalRecordType.resource,
+                &quot;addresses&quot;: CalRecordType.address,
+            }.get(recordTypeName, None)
+            if recordType is None:
+                log.error(&quot;Invalid Record Type: {rt}&quot;, rt=recordTypeName)
+                raise DirectoryConfigurationError
+            if recordType in types:
+                log.error(&quot;Duplicate Record Type: {rt}&quot;, rt=recordTypeName)
+                raise DirectoryConfigurationError
+            types.append(recordType)
+
+        directory.recordType = ConstantsContainer(types)
+        aggregatedServices.append(directory)
+
+    #
+    # Setup the Augment Service
+    #
+    if config.AugmentService.type:
+        augmentClass = namedClass(config.AugmentService.type)
+        log.info(
+            &quot;Configuring augment service of type: {augmentClass}&quot;,
+            augmentClass=augmentClass
+        )
+        try:
+            augmentService = augmentClass(**config.AugmentService.params)
+        except IOError:
+            log.error(&quot;Could not start augment service&quot;)
+            raise
+    else:
+        augmentService = None
+
+    userDirectory = None
+    for directory in aggregatedServices:
+        if RecordType.user in directory.recordTypes():
+            userDirectory = directory
+            break
+    else:
+        log.error(&quot;No directory service set up for users&quot;)
+        raise DirectoryConfigurationError
+
+    delegateDirectory = DelegateDirectoryService(
+        userDirectory.realmName,
+        store
+    )
+    aggregatedServices.append(delegateDirectory)
+
+    aggregateDirectory = AggregateDirectoryService(
+        userDirectory.realmName, aggregatedServices
+    )
+    try:
+        augmented = AugmentedDirectoryService(
+            aggregateDirectory, store, augmentService
+        )
+
+        # The delegate directory needs a way to look up user/group records
+        # so hand it a reference to the augmented directory.
+        # FIXME: is there a better pattern to use here?
+        delegateDirectory.setMasterDirectory(augmented)
+
+    except Exception as e:
+        log.error(&quot;Could not create directory service&quot;, error=e)
+        raise
+
+    return augmented
</ins></span></pre>
</div>
</div>

</body>
</html>