<!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>[12865] 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/12865">12865</a></dd>
<dt>Author</dt> <dd>sagen@apple.com</dd>
<dt>Date</dt> <dd>2014-03-10 11:19:32 -0700 (Mon, 10 Mar 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Start moving older unit tests over to new directory API</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServerbranchesuserssagenmove2who2twistedcaldavdirectorytestaccountsxml">CalendarServer/branches/users/sagen/move2who-2/twistedcaldav/directory/test/accounts.xml</a></li>
<li><a href="#CalendarServerbranchesuserssagenmove2who2twistedcaldavtestutilpy">CalendarServer/branches/users/sagen/move2who-2/twistedcaldav/test/util.py</a></li>
<li><a href="#CalendarServerbranchesuserssagenmove2who2txdavdpsserverpy">CalendarServer/branches/users/sagen/move2who-2/txdav/dps/server.py</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServerbranchesuserssagenmove2who2twistedcaldavdirectorytestaccountsxml"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-2/twistedcaldav/directory/test/accounts.xml (12864 => 12865)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-2/twistedcaldav/directory/test/accounts.xml        2014-03-10 17:52:25 UTC (rev 12864)
+++ CalendarServer/branches/users/sagen/move2who-2/twistedcaldav/directory/test/accounts.xml        2014-03-10 18:19:32 UTC (rev 12865)
</span><span class="lines">@@ -18,279 +18,261 @@
</span><span class="cx">
</span><span class="cx"> <!DOCTYPE accounts SYSTEM "../../../conf/auth/accounts.dtd">
</span><span class="cx">
</span><del>-<accounts realm="Test">
- <user>
- <uid>admin</uid>
- <guid>D11F03A0-97EA-48AF-9A6C-FAC7F3975766</guid>
</del><ins>+<directory realm="Test">
+ <record type="user">
+ <short-name>admin</short-name>
+ <uid>D11F03A0-97EA-48AF-9A6C-FAC7F3975766</uid>
</ins><span class="cx"> <password>nimda</password>
</span><del>- <name>Administrators</name>
- </user>
- <user>
- <uid>wsanchez</uid>
- <guid>6423F94A-6B76-4A3A-815B-D52CFD77935D</guid>
</del><ins>+ <full-name>Administrators</full-name>
+ </record>
+ <record type="user">
+ <short-name>wsanchez</short-name>
+ <uid>6423F94A-6B76-4A3A-815B-D52CFD77935D</uid>
</ins><span class="cx"> <password>zehcnasw</password>
</span><del>- <name>Wilfredo Sanchez</name>
- <email-address>wsanchez@example.com</email-address>
- </user>
- <user>
- <uid>cdaboo</uid>
- <guid>5A985493-EE2C-4665-94CF-4DFEA3A89500</guid>
</del><ins>+ <full-name>Wilfredo Sanchez</full-name>
+ <email>wsanchez@example.com</email>
+ </record>
+ <record type="user">
+ <short-name>cdaboo</short-name>
+ <uid>5A985493-EE2C-4665-94CF-4DFEA3A89500</uid>
</ins><span class="cx"> <password>oobadc</password>
</span><del>- <name>Cyrus Daboo</name>
- <email-address>cdaboo@example.com</email-address>
- </user>
- <user>
- <uid>lecroy</uid>
- <guid>8B4288F6-CC82-491D-8EF9-642EF4F3E7D0</guid>
</del><ins>+ <full-name>Cyrus Daboo</full-name>
+ <email>cdaboo@example.com</email>
+ </record>
+ <record type="user">
+ <short-name>lecroy</short-name>
+ <uid>8B4288F6-CC82-491D-8EF9-642EF4F3E7D0</uid>
</ins><span class="cx"> <password>yorcel</password>
</span><del>- <name>Chris Lecroy</name>
- <email-address>lecroy@example.com</email-address>
- </user>
- <user>
- <uid>dreid</uid>
- <guid>5FF60DAD-0BDE-4508-8C77-15F0CA5C8DD1</guid>
</del><ins>+ <full-name>Chris Lecroy</full-name>
+ <email>lecroy@example.com</email>
+ </record>
+ <record type="user">
+ <short-name>dreid</short-name>
+ <uid>5FF60DAD-0BDE-4508-8C77-15F0CA5C8DD1</uid>
</ins><span class="cx"> <password>dierd</password>
</span><del>- <name>David Reid</name>
- <email-address>dreid@example.com</email-address>
- </user>
- <user>
- <uid>doublequotes</uid>
- <guid>8E04787E-336D-41ED-A70B-D233AD0DCE6F</guid>
</del><ins>+ <full-name>David Reid</full-name>
+ <email>dreid@example.com</email>
+ </record>
+ <record type="user">
+ <short-name>doublequotes</short-name>
+ <uid>8E04787E-336D-41ED-A70B-D233AD0DCE6F</uid>
</ins><span class="cx"> <password>setouqelbuod</password>
</span><del>- <name>Double "quotey" Quotes</name>
- <email-address>doublequotes@example.com</email-address>
- </user>
- <user>
- <uid>nocalendar</uid>
- <guid>543D28BA-F74F-4D5F-9243-B3E3A61171E5</guid>
</del><ins>+ <full-name>Double "quotey" Quotes</full-name>
+ <email>doublequotes@example.com</email>
+ </record>
+ <record type="user">
+ <short-name>nocalendar</short-name>
+ <uid>543D28BA-F74F-4D5F-9243-B3E3A61171E5</uid>
</ins><span class="cx"> <password>radnelacon</password>
</span><del>- <name>No Calendar</name>
- <email-address>nocalendar@example.com</email-address>
- </user>
- <user>
- <uid>usera</uid>
- <guid>7423F94A-6B76-4A3A-815B-D52CFD77935D</guid>
</del><ins>+ <full-name>No Calendar</full-name>
+ <email>nocalendar@example.com</email>
+ </record>
+ <record type="user">
+ <short-name>usera</short-name>
+ <uid>7423F94A-6B76-4A3A-815B-D52CFD77935D</uid>
</ins><span class="cx"> <password>a</password>
</span><del>- <name>a</name>
- <email-address>a@example.com</email-address>
- </user>
- <user>
- <uid>userb</uid>
- <guid>8A985493-EE2C-4665-94CF-4DFEA3A89500</guid>
</del><ins>+ <full-name>a</full-name>
+ <email>a@example.com</email>
+ </record>
+ <record type="user">
+ <short-name>userb</short-name>
+ <uid>8A985493-EE2C-4665-94CF-4DFEA3A89500</uid>
</ins><span class="cx"> <password>b</password>
</span><del>- <name>b</name>
- <email-address>b@example.com</email-address>
- </user>
- <user>
- <uid>userc</uid>
- <guid>9FF60DAD-0BDE-4508-8C77-15F0CA5C8DD2</guid>
</del><ins>+ <full-name>b</full-name>
+ <email>b@example.com</email>
+ </record>
+ <record type="user">
+ <short-name>userc</short-name>
+ <uid>9FF60DAD-0BDE-4508-8C77-15F0CA5C8DD2</uid>
</ins><span class="cx"> <password>c</password>
</span><del>- <name>c</name>
- <email-address>c@example.com</email-address>
- </user>
- <user>
- <uid>usercalonly</uid>
- <guid>9E1FFAC4-3CCD-45A1-8272-D161C92D2EEE</guid>
</del><ins>+ <full-name>c</full-name>
+ <email>c@example.com</email>
+ </record>
+ <record type="user">
+ <short-name>usercalonly</short-name>
+ <uid>9E1FFAC4-3CCD-45A1-8272-D161C92D2EEE</uid>
</ins><span class="cx"> <password>a</password>
</span><del>- <name>a calonly</name>
- <email-address>a-calonly@example.com</email-address>
- </user>
- <user>
- <uid>useradbkonly</uid>
- <guid>7678EC8A-A069-4E82-9066-7279C6718507</guid>
</del><ins>+ <full-name>a calonly</full-name>
+ <email>a-calonly@example.com</email>
+ </record>
+ <record type="user">
+ <short-name>useradbkonly</short-name>
+ <uid>7678EC8A-A069-4E82-9066-7279C6718507</uid>
</ins><span class="cx"> <password>a</password>
</span><del>- <name>a adbkonly</name>
- <email-address>a-adbkonly@example.com</email-address>
- </user>
- <user>
- <uid>nonascii</uid>
- <uid>nonascii佐藤</uid>
- <guid>320B73A1-46E2-4180-9563-782DFDBE1F63</guid>
</del><ins>+ <full-name>a adbkonly</full-name>
+ <email>a-adbkonly@example.com</email>
+ </record>
+ <record type="user">
+ <short-name>nonascii</short-name>
+ <short-name>nonascii佐藤</short-name>
+ <uid>320B73A1-46E2-4180-9563-782DFDBE1F63</uid>
</ins><span class="cx"> <password>a</password>
</span><del>- <name>佐藤佐藤佐藤</name>
- <email-address>nonascii@example.com</email-address>
- </user>
- <user>
- <uid>delegator</uid>
- <guid>FC465590-E9E9-4746-ACE8-6C756A49FE4D</guid>
</del><ins>+ <full-name>佐藤佐藤佐藤</full-name>
+ <email>nonascii@example.com</email>
+ </record>
+ <record type="user">
+ <short-name>delegator</short-name>
+ <uid>FC465590-E9E9-4746-ACE8-6C756A49FE4D</uid>
</ins><span class="cx"> <password>a</password>
</span><del>- <name>Calendar Delegator</name>
- <email-address>calendardelegator@example.com</email-address>
- </user>
- <user>
- <uid>occasionaldelegate</uid>
- <guid>EC465590-E9E9-4746-ACE8-6C756A49FE4D</guid>
</del><ins>+ <full-name>Calendar Delegator</full-name>
+ <email>calendardelegator@example.com</email>
+ </record>
+ <record type="user">
+ <short-name>occasionaldelegate</short-name>
+ <uid>EC465590-E9E9-4746-ACE8-6C756A49FE4D</uid>
</ins><span class="cx"> <password>a</password>
</span><del>- <name>Occasional Delegate</name>
- <email-address>occasional@example.com</email-address>
- </user>
- <user>
- <uid>delegateviagroup</uid>
- <guid>46D9D716-CBEE-490F-907A-66FA6C3767FF</guid>
</del><ins>+ <full-name>Occasional Delegate</full-name>
+ <email>occasional@example.com</email>
+ </record>
+ <record type="user">
+ <short-name>delegateviagroup</short-name>
+ <uid>46D9D716-CBEE-490F-907A-66FA6C3767FF</uid>
</ins><span class="cx"> <password>a</password>
</span><del>- <name>Delegate Via Group</name>
- <email-address>delegateviagroup@example.com</email-address>
- </user>
- <group>
- <uid>delegategroup</uid>
- <guid>00599DAF-3E75-42DD-9DB7-52617E79943F</guid>
- <name>Delegate Group</name>
- <members>
- <member type="users">delegateviagroup</member>
- </members>
- </group>
</del><ins>+ <full-name>Delegate Via Group</full-name>
+ <email>delegateviagroup@example.com</email>
+ </record>
+ <record type="group">
+ <short-name>delegategroup</short-name>
+ <uid>00599DAF-3E75-42DD-9DB7-52617E79943F</uid>
+ <full-name>Delegate Group</full-name>
+ <member-uid>delegateviagroup</member-uid>
+ </record>
</ins><span class="cx"> <user repeat="100">
</span><ins>+ <short-name>user%02d</short-name>
</ins><span class="cx"> <uid>user%02d</uid>
</span><del>- <guid>user%02d</guid>
</del><span class="cx"> <password>%02duser</password>
</span><del>- <name>~35 User %02d</name>
</del><ins>+ <full-name>~35 User %02d</full-name>
</ins><span class="cx"> <first-name>~5</first-name>
</span><span class="cx"> <last-name>~9 User %02d</last-name>
</span><del>- <email-address>~10@example.com</email-address>
</del><ins>+ <email>~10@example.com</email>
</ins><span class="cx"> </user>
</span><del>- <group>
- <uid>managers</uid>
- <guid>9FF60DAD-0BDE-4508-8C77-15F0CA5C8DD1</guid>
</del><ins>+ <record type="group">
+ <short-name>managers</short-name>
+ <uid>9FF60DAD-0BDE-4508-8C77-15F0CA5C8DD1</uid>
</ins><span class="cx"> <password>managers</password>
</span><del>- <name>Managers</name>
- <members>
- <member type="users">lecroy</member>
- </members>
- </group>
- <group>
</del><ins>+ <full-name>Managers</full-name>
+ <member-uid>lecroy</member-uid>
+ </record>
+ <record type="group">
+ <short-name>admin</short-name>
</ins><span class="cx"> <uid>admin</uid>
</span><del>- <guid>admin</guid>
</del><span class="cx"> <password>admin</password>
</span><del>- <name>Administrators</name>
- <members>
- <member type="groups">managers</member>
- </members>
- </group>
- <group>
</del><ins>+ <full-name>Administrators</full-name>
+ <member-uid>managers</member-uid>
+ </record>
+ <record type="group">
+ <short-name>grunts</short-name>
</ins><span class="cx"> <uid>grunts</uid>
</span><del>- <guid>grunts</guid>
</del><span class="cx"> <password>grunts</password>
</span><del>- <name>We do all the work</name>
- <members>
- <member>wsanchez</member>
- <member>cdaboo</member>
- <member>dreid</member>
- </members>
- </group>
- <group>
</del><ins>+ <full-name>We do all the work</full-name>
+ <member-uid>wsanchez</member-uid>
+ <member-uid>cdaboo</member-uid>
+ <member-uid>dreid</member-uid>
+ </record>
+ <record type="group">
+ <short-name>right_coast</short-name>
</ins><span class="cx"> <uid>right_coast</uid>
</span><del>- <guid>right_coast</guid>
</del><span class="cx"> <password>right_coast</password>
</span><del>- <name>East Coast</name>
- <members>
- <member>cdaboo</member>
- </members>
- </group>
- <group>
</del><ins>+ <full-name>East Coast</full-name>
+ <member-uid>cdaboo</member-uid>
+ </record>
+ <record type="group">
+ <short-name>left_coast</short-name>
</ins><span class="cx"> <uid>left_coast</uid>
</span><del>- <guid>left_coast</guid>
</del><span class="cx"> <password>left_coast</password>
</span><del>- <name>West Coast</name>
- <members>
- <member>wsanchez</member>
- <member>lecroy</member>
- <member>dreid</member>
- </members>
- </group>
- <group>
</del><ins>+ <full-name>West Coast</full-name>
+ <member-uid>wsanchez</member-uid>
+ <member-uid>lecroy</member-uid>
+ <member-uid>dreid</member-uid>
+ </record>
+ <record type="group">
+ <short-name>both_coasts</short-name>
</ins><span class="cx"> <uid>both_coasts</uid>
</span><del>- <guid>both_coasts</guid>
</del><span class="cx"> <password>both_coasts</password>
</span><del>- <name>Both Coasts</name>
- <members>
- <member type="groups">right_coast</member>
- <member type="groups">left_coast</member>
- </members>
- </group>
- <group>
</del><ins>+ <full-name>Both Coasts</full-name>
+ <member-uid>right_coast</member-uid>
+ <member-uid>left_coast</member-uid>
+ </record>
+ <record type="group">
+ <short-name>recursive1_coasts</short-name>
</ins><span class="cx"> <uid>recursive1_coasts</uid>
</span><del>- <guid>recursive1_coasts</guid>
</del><span class="cx"> <password>recursive1_coasts</password>
</span><del>- <name>Recursive1 Coasts</name>
- <members>
- <member type="groups">recursive2_coasts</member>
- <member>wsanchez</member>
- </members>
- </group>
- <group>
</del><ins>+ <full-name>Recursive1 Coasts</full-name>
+ <member-uid>recursive2_coasts</member-uid>
+ <member-uid>wsanchez</member-uid>
+ </record>
+ <record type="group">
+ <short-name>recursive2_coasts</short-name>
</ins><span class="cx"> <uid>recursive2_coasts</uid>
</span><del>- <guid>recursive2_coasts</guid>
</del><span class="cx"> <password>recursive2_coasts</password>
</span><del>- <name>Recursive2 Coasts</name>
- <members>
- <member type="groups">recursive1_coasts</member>
- <member>cdaboo</member>
- </members>
- </group>
- <group>
</del><ins>+ <full-name>Recursive2 Coasts</full-name>
+ <member-uid>recursive1_coasts</member-uid>
+ <member-uid>cdaboo</member-uid>
+ </record>
+ <record type="group">
+ <short-name>non_calendar_group</short-name>
</ins><span class="cx"> <uid>non_calendar_group</uid>
</span><del>- <guid>non_calendar_group</guid>
</del><span class="cx"> <password>non_calendar_group</password>
</span><del>- <name>Non-calendar group</name>
- <members>
- <member>cdaboo</member>
- <member>lecroy</member>
- </members>
- </group>
</del><ins>+ <full-name>Non-calendar group</full-name>
+ <member-uid>cdaboo</member-uid>
+ <member-uid>lecroy</member-uid>
+ </record>
+ <!--
</ins><span class="cx"> <location>
</span><span class="cx"> <uid>mercury</uid>
</span><del>- <guid>mercury</guid>
</del><ins>+ <uid>mercury</uid>
</ins><span class="cx"> <password>mercury</password>
</span><span class="cx"> <name>Mercury Seven</name>
</span><span class="cx"> <email-address>mercury@example.com</email-address>
</span><span class="cx"> </location>
</span><span class="cx"> <location>
</span><span class="cx"> <uid>gemini</uid>
</span><del>- <guid>gemini</guid>
</del><ins>+ <uid>gemini</uid>
</ins><span class="cx"> <password>gemini</password>
</span><span class="cx"> <name>Gemini Twelve</name>
</span><span class="cx"> <email-address>gemini@example.com</email-address>
</span><span class="cx"> </location>
</span><span class="cx"> <location>
</span><span class="cx"> <uid>apollo</uid>
</span><del>- <guid>apollo</guid>
</del><ins>+ <uid>apollo</uid>
</ins><span class="cx"> <password>apollo</password>
</span><span class="cx"> <name>Apollo Eleven</name>
</span><span class="cx"> <email-address>apollo@example.com</email-address>
</span><span class="cx"> </location>
</span><span class="cx"> <location>
</span><span class="cx"> <uid>orion</uid>
</span><del>- <guid>orion</guid>
</del><ins>+ <uid>orion</uid>
</ins><span class="cx"> <password>orion</password>
</span><span class="cx"> <name>Orion</name>
</span><span class="cx"> <email-address>orion@example.com</email-address>
</span><span class="cx"> </location>
</span><span class="cx"> <resource>
</span><span class="cx"> <uid>transporter</uid>
</span><del>- <guid>transporter</guid>
</del><ins>+ <uid>transporter</uid>
</ins><span class="cx"> <password>transporter</password>
</span><span class="cx"> <name>Mass Transporter</name>
</span><span class="cx"> <email-address>transporter@example.com</email-address>
</span><span class="cx"> </resource>
</span><span class="cx"> <resource>
</span><span class="cx"> <uid>ftlcpu</uid>
</span><del>- <guid>ftlcpu</guid>
</del><ins>+ <uid>ftlcpu</uid>
</ins><span class="cx"> <password>ftlcpu</password>
</span><span class="cx"> <name>Faster-Than-Light Microprocessor</name>
</span><span class="cx"> <email-address>ftlcpu@example.com</email-address>
</span><span class="cx"> </resource>
</span><span class="cx"> <resource>
</span><span class="cx"> <uid>non_calendar_proxy</uid>
</span><del>- <guid>non_calendar_proxy</guid>
</del><ins>+ <uid>non_calendar_proxy</uid>
</ins><span class="cx"> <password>non_calendar_proxy</password>
</span><span class="cx"> <name>Non-calendar proxy</name>
</span><span class="cx"> <email-address>non_calendar_proxy@example.com</email-address>
</span><span class="cx"> </resource>
</span><span class="cx"> <resource>
</span><span class="cx"> <uid>disabled</uid>
</span><del>- <guid>disabled</guid>
</del><ins>+ <uid>disabled</uid>
</ins><span class="cx"> <password>disabled</password>
</span><span class="cx"> <name>Disabled Record</name>
</span><span class="cx"> <email-address>disabled@example.com</email-address>
</span><span class="cx"> </resource>
</span><del>-</accounts>
</del><ins>+-->
+</directory>
</ins></span></pre></div>
<a id="CalendarServerbranchesuserssagenmove2who2twistedcaldavtestutilpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-2/twistedcaldav/test/util.py (12864 => 12865)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-2/twistedcaldav/test/util.py        2014-03-10 17:52:25 UTC (rev 12864)
+++ CalendarServer/branches/users/sagen/move2who-2/twistedcaldav/test/util.py        2014-03-10 18:19:32 UTC (rev 12865)
</span><span class="lines">@@ -17,46 +17,41 @@
</span><span class="cx"> from __future__ import with_statement
</span><span class="cx">
</span><span class="cx"> import os
</span><del>-import xattr
</del><span class="cx">
</span><del>-from twistedcaldav.stdconfig import config
-
-from twisted.python.failure import Failure
</del><ins>+from calendarserver.provision.root import RootResource
+from calendarserver.tap.util import getRootResource
+from twext.python.filepath import CachingFilePath as FilePath
+from twext.python.log import Logger
</ins><span class="cx"> from twisted.internet.base import DelayedCall
</span><span class="cx"> from twisted.internet.defer import succeed, fail, inlineCallbacks, returnValue
</span><span class="cx"> from twisted.internet.protocol import ProcessProtocol
</span><del>-
-from twext.python.filepath import CachingFilePath as FilePath
-import txweb2.dav.test.util
-from txdav.xml import element as davxml, element
-from txweb2.http import HTTPError, StatusResponse
-
</del><ins>+from twisted.python.failure import Failure
</ins><span class="cx"> from twistedcaldav import memcacher
</span><del>-from twistedcaldav.memcacheclient import ClientFactory
</del><span class="cx"> from twistedcaldav.bind import doBind
</span><span class="cx"> from twistedcaldav.directory import augment
</span><span class="cx"> from twistedcaldav.directory.addressbook import DirectoryAddressBookHomeProvisioningResource
</span><ins>+from twistedcaldav.directory.aggregate import AggregateDirectoryService
</ins><span class="cx"> from twistedcaldav.directory.calendar import (
</span><span class="cx"> DirectoryCalendarHomeProvisioningResource
</span><span class="cx"> )
</span><ins>+from twistedcaldav.directory.directory import DirectoryService
</ins><span class="cx"> from twistedcaldav.directory.principal import (
</span><span class="cx"> DirectoryPrincipalProvisioningResource)
</span><del>-from twistedcaldav.directory.aggregate import AggregateDirectoryService
</del><ins>+from twistedcaldav.directory.util import transactionFromRequest
</ins><span class="cx"> from twistedcaldav.directory.xmlfile import XMLDirectoryService
</span><del>-
</del><ins>+from twistedcaldav.memcacheclient import ClientFactory
+from twistedcaldav.stdconfig import config
+from txdav.caldav.datastore.test.util import buildCalendarStore
+from txdav.common.datastore.file import CommonDataStore
</ins><span class="cx"> from txdav.common.datastore.test.util import deriveQuota, CommonCommonTests
</span><del>-from txdav.common.datastore.file import CommonDataStore
</del><ins>+from txdav.dps.server import directoryFromConfig
+from txdav.xml import element as davxml, element
+from txweb2.dav.test.util import SimpleRequest
+import txweb2.dav.test.util
+from txweb2.http import HTTPError, StatusResponse
+import xattr
</ins><span class="cx">
</span><del>-from calendarserver.provision.root import RootResource
</del><span class="cx">
</span><del>-from twext.python.log import Logger
-from calendarserver.tap.util import getRootResource
-from txweb2.dav.test.util import SimpleRequest
-from twistedcaldav.directory.util import transactionFromRequest
-from twistedcaldav.directory.directory import DirectoryService
-from txdav.caldav.datastore.test.util import buildCalendarStore
-from txdav.dps.server import directoryFromConfig
-
</del><span class="cx"> log = Logger()
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -68,10 +63,12 @@
</span><span class="cx"> ]
</span><span class="cx"> DelayedCall.debug = True
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> def _todo(f, why):
</span><span class="cx"> f.todo = why
</span><span class="cx"> return f
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> featureUnimplemented = lambda f: _todo(f, "Feature unimplemented")
</span><span class="cx"> testUnimplemented = lambda f: _todo(f, "Test unimplemented")
</span><span class="cx"> todo = lambda why: lambda f: _todo(f, why)
</span><span class="lines">@@ -199,9 +196,13 @@
</span><span class="cx">
</span><span class="cx"> self.configure()
</span><span class="cx">
</span><del>- self._sqlCalendarStore = yield buildCalendarStore(self, self.notifierFactory, directoryFromConfig(config))
</del><ins>+ self._sqlCalendarStore = yield buildCalendarStore(
+ self, self.notifierFactory, None
+ )
+ self.directory = directoryFromConfig(config, self._sqlCalendarStore)
+ self._sqlCalendarStore.setDirectoryService(self.directory)
+
</ins><span class="cx"> self.rootResource = getRootResource(config, self._sqlCalendarStore)
</span><del>- self.directory = self._sqlCalendarStore.directoryService()
</del><span class="cx">
</span><span class="cx"> self.principalsResource = DirectoryPrincipalProvisioningResource("/principals/", self.directory)
</span><span class="cx"> self.site.resource.putChild("principals", self.principalsResource)
</span><span class="lines">@@ -289,11 +290,16 @@
</span><span class="cx"> """
</span><span class="cx"> self.xmlFile = FilePath(config.DataRoot).child("accounts.xml")
</span><span class="cx"> self.xmlFile.setContent(xmlFile.getContent())
</span><del>- self.directoryFixture.addDirectoryService(XMLDirectoryService({
- "xmlFile": "accounts.xml",
- "augmentService":
- augment.AugmentXMLDB(xmlFiles=(augmentsFile.path,)),
- }))
</del><ins>+ self.directoryFixture.addDirectoryService(
+ XMLDirectoryService(
+ {
+ "xmlFile": "accounts.xml",
+ "augmentService": augment.AugmentXMLDB(
+ xmlFiles=(augmentsFile.path,)
+ ),
+ }
+ )
+ )
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def setupCalendars(self):
</span><span class="lines">@@ -309,6 +315,8 @@
</span><span class="cx"> L{TestCase.directoryFixture.addDirectoryService}.
</span><span class="cx"> """
</span><span class="cx"> newStore = self.createDataStore()
</span><ins>+
+
</ins><span class="cx"> @self.directoryFixture.whenDirectoryServiceChanges
</span><span class="cx"> def putAllChildren(ds):
</span><span class="cx"> self.calendarCollection = (
</span><span class="lines">@@ -507,7 +515,7 @@
</span><span class="cx"> print("Xattr mismatch:", childPath, attr)
</span><span class="cx"> print((xattr.getxattr(childPath, attr), " != ", value))
</span><span class="cx"> return False
</span><del>- else: # method
</del><ins>+ else: # method
</ins><span class="cx"> if not value(xattr.getxattr(childPath, attr)):
</span><span class="cx"> return False
</span><span class="cx">
</span><span class="lines">@@ -557,6 +565,8 @@
</span><span class="cx"> """
</span><span class="cx"> super(HomeTestCase, self).setUp()
</span><span class="cx"> self.createStockDirectoryService()
</span><ins>+
+
</ins><span class="cx"> @self.directoryFixture.whenDirectoryServiceChanges
</span><span class="cx"> def addHomeProvisioner(ds):
</span><span class="cx"> self.homeProvisioner = DirectoryCalendarHomeProvisioningResource(
</span><span class="lines">@@ -641,6 +651,8 @@
</span><span class="cx"> """
</span><span class="cx"> super(AddressBookHomeTestCase, self).setUp()
</span><span class="cx"> self.createStockDirectoryService()
</span><ins>+
+
</ins><span class="cx"> @self.directoryFixture.whenDirectoryServiceChanges
</span><span class="cx"> def addHomeProvisioner(ds):
</span><span class="cx"> self.homeProvisioner = DirectoryAddressBookHomeProvisioningResource(
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagenmove2who2txdavdpsserverpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-2/txdav/dps/server.py (12864 => 12865)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-2/txdav/dps/server.py        2014-03-10 17:52:25 UTC (rev 12864)
+++ CalendarServer/branches/users/sagen/move2who-2/txdav/dps/server.py        2014-03-10 18:19:32 UTC (rev 12865)
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx"> from twisted.python.filepath import FilePath
</span><span class="cx"> from twisted.python.reflect import namedClass
</span><span class="cx"> from twisted.python.usage import Options, UsageError
</span><del>-from twistedcaldav.config import config
</del><ins>+from twistedcaldav.config import config, fullServerPath
</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">@@ -421,44 +421,64 @@
</span><span class="cx">
</span><span class="cx"> def directoryFromConfig(config, store=None):
</span><span class="cx"> """
</span><del>- Return a directory service based on the config
</del><ins>+ 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
</ins><span class="cx"> """
</span><del>- directoryType = config.DirectoryProxy.DirectoryType
- args = config.DirectoryProxy.Arguments
- kwds = config.DirectoryProxy.Keywords
</del><span class="cx">
</span><del>- # FIXME: this needs to talk to its own separate database
</del><ins>+ # 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.
</ins><span class="cx"> pool, txnFactory = getDBPool(config)
</span><span class="cx"> if store is None:
</span><span class="cx"> store = storeFromConfig(config, txnFactory, None)
</span><span class="cx">
</span><del>- if directoryType == "OD":
- from twext.who.opendirectory import DirectoryService as ODDirectoryService
- primaryDirectory = ODDirectoryService(*args, **kwds)
</del><ins>+ # directoryType = config.DirectoryProxy.DirectoryType
+ directoryType = config.DirectoryService.type
</ins><span class="cx">
</span><del>- elif directoryType == "LDAP":
- authDN = kwds.pop("authDN", "")
- password = kwds.pop("password", "")
- if authDN and password:
- creds = UsernamePassword(authDN, password)
- else:
- creds = None
- kwds["credentials"] = creds
- debug = kwds.pop("debug", "")
- primaryDirectory = LDAPDirectoryService(
- *args, _debug=debug, **kwds
- )
</del><ins>+ if "XML" in directoryType:
+ xmlFile = config.DirectoryService.params.xmlFile
+ xmlFile = fullServerPath(config.DataRoot, xmlFile)
+ # path = kwds.pop("path", "")
+ if not xmlFile or not os.path.exists(xmlFile):
+ log.error("Path not found for XML directory: {p}", p=xmlFile)
+ fp = FilePath(xmlFile)
+ primaryDirectory = XMLDirectoryService(fp)
</ins><span class="cx">
</span><del>- elif directoryType == "XML":
- path = kwds.pop("path", "")
- if not path or not os.path.exists(path):
- log.error("Path not found for XML directory: {p}", p=path)
- fp = FilePath(path)
- primaryDirectory = XMLDirectoryService(fp, *args, **kwds)
</del><span class="cx">
</span><del>- else:
- log.error("Invalid DirectoryType: {dt}", dt=directoryType)
</del><ins>+ # FIXME: implement the other service types
</ins><span class="cx">
</span><ins>+ # args = config.DirectoryProxy.Arguments
+ # kwds = config.DirectoryProxy.Keywords
+
+
+ # if directoryType == "OD":
+ # from twext.who.opendirectory import DirectoryService as ODDirectoryService
+ # primaryDirectory = ODDirectoryService(*args, **kwds)
+
+ # elif directoryType == "LDAP":
+ # authDN = kwds.pop("authDN", "")
+ # password = kwds.pop("password", "")
+ # if authDN and password:
+ # creds = UsernamePassword(authDN, password)
+ # else:
+ # creds = None
+ # kwds["credentials"] = creds
+ # debug = kwds.pop("debug", "")
+ # primaryDirectory = LDAPDirectoryService(
+ # *args, _debug=debug, **kwds
+ # )
+
+ # elif directoryType == "XML":
+ # path = kwds.pop("path", "")
+ # if not path or not os.path.exists(path):
+ # log.error("Path not found for XML directory: {p}", p=path)
+ # fp = FilePath(path)
+ # primaryDirectory = XMLDirectoryService(fp, *args, **kwds)
+
+ # else:
+ # log.error("Invalid DirectoryType: {dt}", dt=directoryType)
+
</ins><span class="cx"> #
</span><span class="cx"> # Setup the Augment Service
</span><span class="cx"> #
</span><span class="lines">@@ -522,15 +542,12 @@
</span><span class="cx"> setproctitle("CalendarServer Directory Proxy Service")
</span><span class="cx">
</span><span class="cx"> try:
</span><del>- print("XZZZY AAA")
</del><span class="cx"> directory = directoryFromConfig(config)
</span><del>- print("XZZZY BBB")
</del><span class="cx"> except Exception as e:
</span><span class="cx"> log.error("Failed to create directory service", error=e)
</span><span class="cx"> raise
</span><span class="cx">
</span><span class="cx"> log.info("Created directory service")
</span><del>- print("XZZZY CCCC")
</del><span class="cx">
</span><span class="cx"> return strPortsService(
</span><span class="cx"> "unix:{path}:mode=660".format(
</span></span></pre>
</div>
</div>
</body>
</html>