<!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>[15761] CalendarServer/branches/users/cdaboo/better-next-job</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/15761">15761</a></dd>
<dt>Author</dt> <dd>cdaboo@apple.com</dd>
<dt>Date</dt> <dd>2016-07-12 19:23:31 -0700 (Tue, 12 Jul 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServerbranchesuserscdaboobetternextjobbin_buildsh">CalendarServer/branches/users/cdaboo/better-next-job/bin/_build.sh</a></li>
<li><a href="#CalendarServerbranchesuserscdaboobetternextjobcalendarservertapcaldavpy">CalendarServer/branches/users/cdaboo/better-next-job/calendarserver/tap/caldav.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboobetternextjobcalendarservertoolsgatewaypy">CalendarServer/branches/users/cdaboo/better-next-job/calendarserver/tools/gateway.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboobetternextjobcalendarservertoolsprincipalspy">CalendarServer/branches/users/cdaboo/better-next-job/calendarserver/tools/principals.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboobetternextjobcalendarservertoolstesttest_principalspy">CalendarServer/branches/users/cdaboo/better-next-job/calendarserver/tools/test/test_principals.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboobetternextjobcalendarservertoolsutilpy">CalendarServer/branches/users/cdaboo/better-next-job/calendarserver/tools/util.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboobetternextjobcalendarserverwebadmindelegationpy">CalendarServer/branches/users/cdaboo/better-next-job/calendarserver/webadmin/delegation.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboobetternextjobconfcaldavdstdconfigplist">CalendarServer/branches/users/cdaboo/better-next-job/conf/caldavd-stdconfig.plist</a></li>
<li><a href="#CalendarServerbranchesuserscdaboobetternextjobtwistedcaldavstdconfigpy">CalendarServer/branches/users/cdaboo/better-next-job/twistedcaldav/stdconfig.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboobetternextjobtxdavcaldavicalendardirectoryservicepy">CalendarServer/branches/users/cdaboo/better-next-job/txdav/caldav/icalendardirectoryservice.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboobetternextjobtxdavdpsclientpy">CalendarServer/branches/users/cdaboo/better-next-job/txdav/dps/client.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboobetternextjobtxdavdpscommandspy">CalendarServer/branches/users/cdaboo/better-next-job/txdav/dps/commands.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboobetternextjobtxdavdpsserverpy">CalendarServer/branches/users/cdaboo/better-next-job/txdav/dps/server.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboobetternextjobtxdavdpstesttest_clientpy">CalendarServer/branches/users/cdaboo/better-next-job/txdav/dps/test/test_client.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboobetternextjobtxdavwhoaugmentpy">CalendarServer/branches/users/cdaboo/better-next-job/txdav/who/augment.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboobetternextjobtxdavwhodirectorypy">CalendarServer/branches/users/cdaboo/better-next-job/txdav/who/directory.py</a></li>
<li><a href="#CalendarServerbranchesuserscdaboobetternextjobtxdavwhotesttest_directorypy">CalendarServer/branches/users/cdaboo/better-next-job/txdav/who/test/test_directory.py</a></li>
</ul>
<h3>Property Changed</h3>
<ul>
<li><a href="#CalendarServerbranchesuserscdaboobetternextjob">CalendarServer/branches/users/cdaboo/better-next-job/</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServerbranchesuserscdaboobetternextjob"></a>
<div class="propset"><h4>Property changes: CalendarServer/branches/users/cdaboo/better-next-job</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnmergeinfo"></a>
<div class="modfile"><h4>Modified: svn:mergeinfo</h4></div>
<span class="cx">/CalendarServer/branches/config-separation:4379-4443
</span><span class="cx">/CalendarServer/branches/egg-info-351:4589-4625
</span><span class="cx">/CalendarServer/branches/generic-sqlstore:6167-6191
</span><span class="cx">/CalendarServer/branches/new-store:5594-5934
</span><span class="cx">/CalendarServer/branches/new-store-no-caldavfile:5911-5935
</span><span class="cx">/CalendarServer/branches/new-store-no-caldavfile-2:5936-5981
</span><span class="cx">/CalendarServer/branches/release/CalendarServer-4.3-dev:10180-10190,10192
</span><span class="cx">/CalendarServer/branches/release/CalendarServer-5.1-dev:11846
</span><span class="cx">/CalendarServer/branches/release/CalendarServer-5.2-dev:11972,12357-12358,12794,12814
</span><span class="cx">/CalendarServer/branches/users/cdaboo/batchupload-6699:6700-7198
</span><span class="cx">/CalendarServer/branches/users/cdaboo/cached-subscription-calendars-5692:5693-5702
</span><span class="cx">/CalendarServer/branches/users/cdaboo/component-set-fixes:8130-8346
</span><span class="cx">/CalendarServer/branches/users/cdaboo/cross-pod-sharing:12038-12191
</span><span class="cx">/CalendarServer/branches/users/cdaboo/directory-cache-on-demand-3627:3628-3644
</span><span class="cx">/CalendarServer/branches/users/cdaboo/fix-no-ischedule:11607-11871
</span><span class="cx">/CalendarServer/branches/users/cdaboo/implicituidrace:8137-8141
</span><span class="cx">/CalendarServer/branches/users/cdaboo/ischedule-dkim:9747-9979
</span><span class="cx">/CalendarServer/branches/users/cdaboo/json:11622-11912
</span><span class="cx">/CalendarServer/branches/users/cdaboo/managed-attachments:9985-10145
</span><span class="cx">/CalendarServer/branches/users/cdaboo/more-sharing-5591:5592-5601
</span><span class="cx">/CalendarServer/branches/users/cdaboo/newlog:15301
</span><span class="cx">/CalendarServer/branches/users/cdaboo/partition-4464:4465-4957
</span><span class="cx">/CalendarServer/branches/users/cdaboo/performance-tweaks:11824-11836
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pod2pod-migration:14338-14520
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pods:7297-7377
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pycalendar:7085-7206
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pycard:7227-7237
</span><span class="cx">/CalendarServer/branches/users/cdaboo/queued-attendee-refreshes:7740-8287
</span><span class="cx">/CalendarServer/branches/users/cdaboo/relative-config-paths-5070:5071-5105
</span><span class="cx">/CalendarServer/branches/users/cdaboo/reverse-proxy-pods:11875-11900
</span><span class="cx">/CalendarServer/branches/users/cdaboo/scheduling-queue-refresh:11783-12557
</span><span class="cx">/CalendarServer/branches/users/cdaboo/shared-calendars-5187:5188-5440
</span><span class="cx">/CalendarServer/branches/users/cdaboo/sharing-in-the-store:11935-12016
</span><span class="cx">/CalendarServer/branches/users/cdaboo/store-scheduling:10876-11129
</span><span class="cx">/CalendarServer/branches/users/cdaboo/timezones:7443-7699
</span><span class="cx">/CalendarServer/branches/users/cdaboo/txn-debugging:8730-8743
</span><span class="cx">/CalendarServer/branches/users/cdaboo/update-packages:15273-15284
</span><span class="cx">/CalendarServer/branches/users/gaya/cleanrevisions:12152-12334
</span><span class="cx">/CalendarServer/branches/users/gaya/groupsharee2:13669-13773
</span><span class="cx">/CalendarServer/branches/users/gaya/sharedgroupfixes:12120-12142
</span><span class="cx">/CalendarServer/branches/users/gaya/sharedgroups-3:11088-11204
</span><span class="cx">/CalendarServer/branches/users/glyph/always-abort-txn-on-error:9958-9969
</span><span class="cx">/CalendarServer/branches/users/glyph/case-insensitive-uid:8772-8805
</span><span class="cx">/CalendarServer/branches/users/glyph/conn-limit:6574-6577
</span><span class="cx">/CalendarServer/branches/users/glyph/contacts-server-merge:4971-5080
</span><span class="cx">/CalendarServer/branches/users/glyph/dalify:6932-7023
</span><span class="cx">/CalendarServer/branches/users/glyph/db-reconnect:6824-6876
</span><span class="cx">/CalendarServer/branches/users/glyph/deploybuild:7563-7572
</span><span class="cx">/CalendarServer/branches/users/glyph/digest-auth-redux:10624-10635
</span><span class="cx">/CalendarServer/branches/users/glyph/disable-quota:7718-7727
</span><span class="cx">/CalendarServer/branches/users/glyph/dont-start-postgres:6592-6614
</span><span class="cx">/CalendarServer/branches/users/glyph/enforce-max-requests:11640-11643
</span><span class="cx">/CalendarServer/branches/users/glyph/hang-fix:11465-11491
</span><span class="cx">/CalendarServer/branches/users/glyph/imip-and-admin-html:7866-7984
</span><span class="cx">/CalendarServer/branches/users/glyph/ipv6-client:9054-9105
</span><span class="cx">/CalendarServer/branches/users/glyph/launchd-wrapper-bis:11413-11436
</span><span class="cx">/CalendarServer/branches/users/glyph/linux-tests:6893-6900
</span><span class="cx">/CalendarServer/branches/users/glyph/log-cleanups:11691-11731
</span><span class="cx">/CalendarServer/branches/users/glyph/migrate-merge:8690-8713
</span><span class="cx">/CalendarServer/branches/users/glyph/misc-portability-fixes:7365-7374
</span><span class="cx">/CalendarServer/branches/users/glyph/more-deferreds-6:6322-6368
</span><span class="cx">/CalendarServer/branches/users/glyph/more-deferreds-7:6369-6445
</span><span class="cx">/CalendarServer/branches/users/glyph/multiget-delete:8321-8330
</span><span class="cx">/CalendarServer/branches/users/glyph/new-export:7444-7485
</span><span class="cx">/CalendarServer/branches/users/glyph/one-home-list-api:10048-10073
</span><span class="cx">/CalendarServer/branches/users/glyph/oracle:7106-7155
</span><span class="cx">/CalendarServer/branches/users/glyph/oracle-nulls:7340-7351
</span><span class="cx">/CalendarServer/branches/users/glyph/other-html:8062-8091
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-sim:8240-8251
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-upgrade:8376-8400
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-upgrade_to_1:8571-8583
</span><span class="cx">/CalendarServer/branches/users/glyph/q:9560-9688
</span><span class="cx">/CalendarServer/branches/users/glyph/queue-locking-and-timing:10204-10289
</span><span class="cx">/CalendarServer/branches/users/glyph/quota:7604-7637
</span><span class="cx">/CalendarServer/branches/users/glyph/sendfdport:5388-5424
</span><span class="cx">/CalendarServer/branches/users/glyph/shared-pool-fixes:8436-8443
</span><span class="cx">/CalendarServer/branches/users/glyph/shared-pool-take2:8155-8174
</span><span class="cx">/CalendarServer/branches/users/glyph/sharedpool:6490-6550
</span><span class="cx">/CalendarServer/branches/users/glyph/sharing-api:9192-9205
</span><span class="cx">/CalendarServer/branches/users/glyph/skip-lonely-vtimezones:8524-8535
</span><span class="cx">/CalendarServer/branches/users/glyph/sql-store:5929-6073
</span><span class="cx">/CalendarServer/branches/users/glyph/start-service-start-loop:11060-11065
</span><span class="cx">/CalendarServer/branches/users/glyph/subtransactions:7248-7258
</span><span class="cx">/CalendarServer/branches/users/glyph/table-alias:8651-8664
</span><span class="cx">/CalendarServer/branches/users/glyph/uidexport:7673-7676
</span><span class="cx">/CalendarServer/branches/users/glyph/unshare-when-access-revoked:10562-10595
</span><span class="cx">/CalendarServer/branches/users/glyph/use-system-twisted:5084-5149
</span><span class="cx">/CalendarServer/branches/users/glyph/uuid-normalize:9268-9296
</span><span class="cx">/CalendarServer/branches/users/glyph/warning-cleanups:11347-11357
</span><span class="cx">/CalendarServer/branches/users/glyph/whenNotProposed:11881-11897
</span><span class="cx">/CalendarServer/branches/users/glyph/xattrs-from-files:7757-7769
</span><span class="cx">/CalendarServer/branches/users/sagen/applepush:8126-8184
</span><span class="cx">/CalendarServer/branches/users/sagen/inboxitems:7380-7381
</span><span class="cx">/CalendarServer/branches/users/sagen/locations-resources:5032-5051
</span><span class="cx">/CalendarServer/branches/users/sagen/locations-resources-2:5052-5061
</span><span class="cx">/CalendarServer/branches/users/sagen/move2who:12819-12860
</span><span class="cx">/CalendarServer/branches/users/sagen/move2who-2:12861-12898
</span><span class="cx">/CalendarServer/branches/users/sagen/move2who-3:12899-12913
</span><span class="cx">/CalendarServer/branches/users/sagen/move2who-4:12914-13157
</span><span class="cx">/CalendarServer/branches/users/sagen/move2who-5:13158-13163
</span><span class="cx">/CalendarServer/branches/users/sagen/newcua:13309-13327
</span><span class="cx">/CalendarServer/branches/users/sagen/newcua-1:13328-13330
</span><span class="cx">/CalendarServer/branches/users/sagen/purge_old_events:6735-6746
</span><span class="cx">/CalendarServer/branches/users/sagen/recordtypes:13648-13656
</span><span class="cx">/CalendarServer/branches/users/sagen/recordtypes-2:13657
</span><span class="cx">/CalendarServer/branches/users/sagen/request-socket:14748-14767
</span><span class="cx">/CalendarServer/branches/users/sagen/resource-delegates-4038:4040-4067
</span><span class="cx">/CalendarServer/branches/users/sagen/resource-delegates-4066:4068-4075
</span><span class="cx">/CalendarServer/branches/users/sagen/resources-2:5084-5093
</span><span class="cx">/CalendarServer/branches/users/sagen/testing:10827-10851,10853-10855
</span><span class="cx">/CalendarServer/branches/users/sagen/trashcan:14185-14269
</span><span class="cx">/CalendarServer/branches/users/sagen/trashcan-2:14270-14324
</span><span class="cx">/CalendarServer/branches/users/sagen/trashcan-3:14325-14450
</span><span class="cx">/CalendarServer/branches/users/sagen/trashcan-4:14451-14471
</span><span class="cx">/CalendarServer/branches/users/sagen/trashcan-5:14471-14555
</span><span class="cx">/CalendarServer/branches/users/wsanchez/psycopg2cffi:14427-14439
</span><span class="cx">/CalendarServer/branches/users/wsanchez/transations:5515-5593
</span><span class="cx">/CalendarServer/trunk:15717-15725,15729-15747,15751-15752
</span><span class="cx"> + /CalDAVTester/trunk:11193-11198
</span><span class="cx">/CalendarServer/branches/config-separation:4379-4443
</span><span class="cx">/CalendarServer/branches/egg-info-351:4589-4625
</span><span class="cx">/CalendarServer/branches/generic-sqlstore:6167-6191
</span><span class="cx">/CalendarServer/branches/new-store:5594-5934
</span><span class="cx">/CalendarServer/branches/new-store-no-caldavfile:5911-5935
</span><span class="cx">/CalendarServer/branches/new-store-no-caldavfile-2:5936-5981
</span><span class="cx">/CalendarServer/branches/release/CalendarServer-4.3-dev:10180-10190,10192
</span><span class="cx">/CalendarServer/branches/release/CalendarServer-5.1-dev:11846
</span><span class="cx">/CalendarServer/branches/release/CalendarServer-5.2-dev:11972,12357-12358,12794,12814
</span><span class="cx">/CalendarServer/branches/users/cdaboo/batchupload-6699:6700-7198
</span><span class="cx">/CalendarServer/branches/users/cdaboo/cached-subscription-calendars-5692:5693-5702
</span><span class="cx">/CalendarServer/branches/users/cdaboo/component-set-fixes:8130-8346
</span><span class="cx">/CalendarServer/branches/users/cdaboo/cross-pod-sharing:12038-12191
</span><span class="cx">/CalendarServer/branches/users/cdaboo/directory-cache-on-demand-3627:3628-3644
</span><span class="cx">/CalendarServer/branches/users/cdaboo/fix-no-ischedule:11607-11871
</span><span class="cx">/CalendarServer/branches/users/cdaboo/implicituidrace:8137-8141
</span><span class="cx">/CalendarServer/branches/users/cdaboo/ischedule-dkim:9747-9979
</span><span class="cx">/CalendarServer/branches/users/cdaboo/json:11622-11912
</span><span class="cx">/CalendarServer/branches/users/cdaboo/managed-attachments:9985-10145
</span><span class="cx">/CalendarServer/branches/users/cdaboo/more-sharing-5591:5592-5601
</span><span class="cx">/CalendarServer/branches/users/cdaboo/newlog:15301
</span><span class="cx">/CalendarServer/branches/users/cdaboo/partition-4464:4465-4957
</span><span class="cx">/CalendarServer/branches/users/cdaboo/performance-tweaks:11824-11836
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pod2pod-migration:14338-14520
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pods:7297-7377
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pycalendar:7085-7206
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pycard:7227-7237
</span><span class="cx">/CalendarServer/branches/users/cdaboo/queued-attendee-refreshes:7740-8287
</span><span class="cx">/CalendarServer/branches/users/cdaboo/relative-config-paths-5070:5071-5105
</span><span class="cx">/CalendarServer/branches/users/cdaboo/reverse-proxy-pods:11875-11900
</span><span class="cx">/CalendarServer/branches/users/cdaboo/scheduling-queue-refresh:11783-12557
</span><span class="cx">/CalendarServer/branches/users/cdaboo/shared-calendars-5187:5188-5440
</span><span class="cx">/CalendarServer/branches/users/cdaboo/sharing-in-the-store:11935-12016
</span><span class="cx">/CalendarServer/branches/users/cdaboo/store-scheduling:10876-11129
</span><span class="cx">/CalendarServer/branches/users/cdaboo/timezones:7443-7699
</span><span class="cx">/CalendarServer/branches/users/cdaboo/txn-debugging:8730-8743
</span><span class="cx">/CalendarServer/branches/users/cdaboo/update-packages:15273-15284
</span><span class="cx">/CalendarServer/branches/users/gaya/cleanrevisions:12152-12334
</span><span class="cx">/CalendarServer/branches/users/gaya/groupsharee2:13669-13773
</span><span class="cx">/CalendarServer/branches/users/gaya/sharedgroupfixes:12120-12142
</span><span class="cx">/CalendarServer/branches/users/gaya/sharedgroups-3:11088-11204
</span><span class="cx">/CalendarServer/branches/users/glyph/always-abort-txn-on-error:9958-9969
</span><span class="cx">/CalendarServer/branches/users/glyph/case-insensitive-uid:8772-8805
</span><span class="cx">/CalendarServer/branches/users/glyph/conn-limit:6574-6577
</span><span class="cx">/CalendarServer/branches/users/glyph/contacts-server-merge:4971-5080
</span><span class="cx">/CalendarServer/branches/users/glyph/dalify:6932-7023
</span><span class="cx">/CalendarServer/branches/users/glyph/db-reconnect:6824-6876
</span><span class="cx">/CalendarServer/branches/users/glyph/deploybuild:7563-7572
</span><span class="cx">/CalendarServer/branches/users/glyph/digest-auth-redux:10624-10635
</span><span class="cx">/CalendarServer/branches/users/glyph/disable-quota:7718-7727
</span><span class="cx">/CalendarServer/branches/users/glyph/dont-start-postgres:6592-6614
</span><span class="cx">/CalendarServer/branches/users/glyph/enforce-max-requests:11640-11643
</span><span class="cx">/CalendarServer/branches/users/glyph/hang-fix:11465-11491
</span><span class="cx">/CalendarServer/branches/users/glyph/imip-and-admin-html:7866-7984
</span><span class="cx">/CalendarServer/branches/users/glyph/ipv6-client:9054-9105
</span><span class="cx">/CalendarServer/branches/users/glyph/launchd-wrapper-bis:11413-11436
</span><span class="cx">/CalendarServer/branches/users/glyph/linux-tests:6893-6900
</span><span class="cx">/CalendarServer/branches/users/glyph/log-cleanups:11691-11731
</span><span class="cx">/CalendarServer/branches/users/glyph/migrate-merge:8690-8713
</span><span class="cx">/CalendarServer/branches/users/glyph/misc-portability-fixes:7365-7374
</span><span class="cx">/CalendarServer/branches/users/glyph/more-deferreds-6:6322-6368
</span><span class="cx">/CalendarServer/branches/users/glyph/more-deferreds-7:6369-6445
</span><span class="cx">/CalendarServer/branches/users/glyph/multiget-delete:8321-8330
</span><span class="cx">/CalendarServer/branches/users/glyph/new-export:7444-7485
</span><span class="cx">/CalendarServer/branches/users/glyph/one-home-list-api:10048-10073
</span><span class="cx">/CalendarServer/branches/users/glyph/oracle:7106-7155
</span><span class="cx">/CalendarServer/branches/users/glyph/oracle-nulls:7340-7351
</span><span class="cx">/CalendarServer/branches/users/glyph/other-html:8062-8091
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-sim:8240-8251
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-upgrade:8376-8400
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-upgrade_to_1:8571-8583
</span><span class="cx">/CalendarServer/branches/users/glyph/q:9560-9688
</span><span class="cx">/CalendarServer/branches/users/glyph/queue-locking-and-timing:10204-10289
</span><span class="cx">/CalendarServer/branches/users/glyph/quota:7604-7637
</span><span class="cx">/CalendarServer/branches/users/glyph/sendfdport:5388-5424
</span><span class="cx">/CalendarServer/branches/users/glyph/shared-pool-fixes:8436-8443
</span><span class="cx">/CalendarServer/branches/users/glyph/shared-pool-take2:8155-8174
</span><span class="cx">/CalendarServer/branches/users/glyph/sharedpool:6490-6550
</span><span class="cx">/CalendarServer/branches/users/glyph/sharing-api:9192-9205
</span><span class="cx">/CalendarServer/branches/users/glyph/skip-lonely-vtimezones:8524-8535
</span><span class="cx">/CalendarServer/branches/users/glyph/sql-store:5929-6073
</span><span class="cx">/CalendarServer/branches/users/glyph/start-service-start-loop:11060-11065
</span><span class="cx">/CalendarServer/branches/users/glyph/subtransactions:7248-7258
</span><span class="cx">/CalendarServer/branches/users/glyph/table-alias:8651-8664
</span><span class="cx">/CalendarServer/branches/users/glyph/uidexport:7673-7676
</span><span class="cx">/CalendarServer/branches/users/glyph/unshare-when-access-revoked:10562-10595
</span><span class="cx">/CalendarServer/branches/users/glyph/use-system-twisted:5084-5149
</span><span class="cx">/CalendarServer/branches/users/glyph/uuid-normalize:9268-9296
</span><span class="cx">/CalendarServer/branches/users/glyph/warning-cleanups:11347-11357
</span><span class="cx">/CalendarServer/branches/users/glyph/whenNotProposed:11881-11897
</span><span class="cx">/CalendarServer/branches/users/glyph/xattrs-from-files:7757-7769
</span><span class="cx">/CalendarServer/branches/users/sagen/applepush:8126-8184
</span><span class="cx">/CalendarServer/branches/users/sagen/inboxitems:7380-7381
</span><span class="cx">/CalendarServer/branches/users/sagen/locations-resources:5032-5051
</span><span class="cx">/CalendarServer/branches/users/sagen/locations-resources-2:5052-5061
</span><span class="cx">/CalendarServer/branches/users/sagen/move2who:12819-12860
</span><span class="cx">/CalendarServer/branches/users/sagen/move2who-2:12861-12898
</span><span class="cx">/CalendarServer/branches/users/sagen/move2who-3:12899-12913
</span><span class="cx">/CalendarServer/branches/users/sagen/move2who-4:12914-13157
</span><span class="cx">/CalendarServer/branches/users/sagen/move2who-5:13158-13163
</span><span class="cx">/CalendarServer/branches/users/sagen/newcua:13309-13327
</span><span class="cx">/CalendarServer/branches/users/sagen/newcua-1:13328-13330
</span><span class="cx">/CalendarServer/branches/users/sagen/purge_old_events:6735-6746
</span><span class="cx">/CalendarServer/branches/users/sagen/recordtypes:13648-13656
</span><span class="cx">/CalendarServer/branches/users/sagen/recordtypes-2:13657
</span><span class="cx">/CalendarServer/branches/users/sagen/request-socket:14748-14767
</span><span class="cx">/CalendarServer/branches/users/sagen/resource-delegates-4038:4040-4067
</span><span class="cx">/CalendarServer/branches/users/sagen/resource-delegates-4066:4068-4075
</span><span class="cx">/CalendarServer/branches/users/sagen/resources-2:5084-5093
</span><span class="cx">/CalendarServer/branches/users/sagen/testing:10827-10851,10853-10855
</span><span class="cx">/CalendarServer/branches/users/sagen/trashcan:14185-14269
</span><span class="cx">/CalendarServer/branches/users/sagen/trashcan-2:14270-14324
</span><span class="cx">/CalendarServer/branches/users/sagen/trashcan-3:14325-14450
</span><span class="cx">/CalendarServer/branches/users/sagen/trashcan-4:14451-14471
</span><span class="cx">/CalendarServer/branches/users/sagen/trashcan-5:14471-14555
</span><span class="cx">/CalendarServer/branches/users/wsanchez/psycopg2cffi:14427-14439
</span><span class="cx">/CalendarServer/branches/users/wsanchez/transations:5515-5593
</span><span class="cx">/CalendarServer/trunk:15717-15725,15729-15747,15751-15752,15754-15757
</span><a id="CalendarServerbranchesuserscdaboobetternextjobbin_buildsh"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/better-next-job/bin/_build.sh (15760 => 15761)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/better-next-job/bin/_build.sh        2016-07-13 02:18:08 UTC (rev 15760)
+++ CalendarServer/branches/users/cdaboo/better-next-job/bin/_build.sh        2016-07-13 02:23:31 UTC (rev 15761)
</span><span class="lines">@@ -168,6 +168,13 @@
</span><span class="cx"> use_openssl="false"
</span><span class="cx"> ;;
</span><span class="cx"> esac;
</span><ins>+ else
+ case "$(uname -s)" in
+ Darwin)
+ # Needed to build OpenSSL 64-bit on OS X
+ export KERNEL_BITS=64
+ ;;
+ esac
</ins><span class="cx"> fi;
</span><span class="cx"> conditional_set requirements "${default_requirements}"
</span><span class="cx">
</span><span class="lines">@@ -490,7 +497,7 @@
</span><span class="cx"> if [ ${use_openssl} == "true" ]; then
</span><span class="cx"> ruler;
</span><span class="cx">
</span><del>- local min_ssl_version="9470095"; # OpenSSL 0.9.8zf
</del><ins>+ local min_ssl_version="268443791"; # OpenSSL 1.0.2h
</ins><span class="cx">
</span><span class="cx"> local ssl_version="$(c_macro openssl/ssl.h OPENSSL_VERSION_NUMBER)";
</span><span class="cx"> if [ -z "${ssl_version}" ]; then ssl_version="0x0"; fi;
</span><span class="lines">@@ -499,13 +506,13 @@
</span><span class="cx"> if [ "${ssl_version}" -ge "${min_ssl_version}" ]; then
</span><span class="cx"> using_system "OpenSSL";
</span><span class="cx"> else
</span><del>- local v="0.9.8zh";
</del><ins>+ local v="1.0.2h";
</ins><span class="cx"> local n="openssl";
</span><span class="cx"> local p="${n}-${v}";
</span><span class="cx">
</span><span class="cx"> # use 'config' instead of 'configure'; 'make' instead of 'jmake'.
</span><span class="cx"> # also pass 'shared' to config to build shared libs.
</span><del>- c_dependency -c "config" -s "3ff71636bea85a99f4d76a10d119c09bda0421e3" \
</del><ins>+ c_dependency -c "config" -s "577585f5f5d299c44dd3c993d3c0ac7a219e4949" \
</ins><span class="cx"> -p "make depend" -b "make" \
</span><span class="cx"> "openssl" "${p}" \
</span><span class="cx"> "http://www.openssl.org/source/${p}.tar.gz" "shared";
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboobetternextjobcalendarservertapcaldavpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/better-next-job/calendarserver/tap/caldav.py (15760 => 15761)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/better-next-job/calendarserver/tap/caldav.py        2016-07-13 02:18:08 UTC (rev 15760)
+++ CalendarServer/branches/users/cdaboo/better-next-job/calendarserver/tap/caldav.py        2016-07-13 02:23:31 UTC (rev 15761)
</span><span class="lines">@@ -245,6 +245,7 @@
</span><span class="cx"> self.logRotateLength = logRotateLength
</span><span class="cx"> self.logMaxFiles = logMaxFiles
</span><span class="cx"> self.logRotateOnStart = logRotateOnStart
</span><ins>+ self.name = "elms"
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def setServiceParent(self, app):
</span><span class="lines">@@ -280,7 +281,7 @@
</span><span class="cx"> # The ConnectionService is a MultiService which bundles all the connection
</span><span class="cx"> # services together for the purposes of being able to stop them and wait
</span><span class="cx"> # for all of their connections to close before shutting down.
</span><del>- connectionServiceName = "ConnectionService"
</del><ins>+ connectionServiceName = "cs"
</ins><span class="cx">
</span><span class="cx"> def __init__(self, logObserver):
</span><span class="cx"> self.logObserver = logObserver # accesslog observer
</span><span class="lines">@@ -292,6 +293,7 @@
</span><span class="cx"> config.ErrorLogMaxRotatedFiles,
</span><span class="cx"> config.ErrorLogRotateOnStart,
</span><span class="cx"> )
</span><ins>+ self.name = "cds"
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def privilegedStartService(self):
</span><span class="lines">@@ -862,6 +864,11 @@
</span><span class="cx"> frame=frame
</span><span class="cx"> )
</span><span class="cx">
</span><ins>+ if config.Manhole.Enabled:
+ namespace= dict({service.name: service})
+ for n, s in service.namedServices.iteritems():
+ namespace[n] = s
+ self._makeManhole(namespace=namespace, parent=service)
</ins><span class="cx"> return service
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -898,6 +905,7 @@
</span><span class="cx"> result = self.requestProcessingService(options, store, logObserver)
</span><span class="cx">
</span><span class="cx"> if pool is not None:
</span><ins>+ pool.setName("db")
</ins><span class="cx"> pool.setServiceParent(result)
</span><span class="cx">
</span><span class="cx"> if config.ControlSocket:
</span><span class="lines">@@ -937,6 +945,7 @@
</span><span class="cx"> controlClient = ControlSocketConnectingService(
</span><span class="cx"> endpointFactory, controlSocketClient
</span><span class="cx"> )
</span><ins>+ controlClient.setName("control")
</ins><span class="cx"> controlClient.setServiceParent(result)
</span><span class="cx">
</span><span class="cx"> # Optionally set up push notifications
</span><span class="lines">@@ -947,6 +956,7 @@
</span><span class="cx"> pushSubService = ApplePushNotifierService.makeService(
</span><span class="cx"> config.Notifications.Services.APNS, store)
</span><span class="cx"> observers.append(pushSubService)
</span><ins>+ pushSubService.setName("APNS")
</ins><span class="cx"> pushSubService.setServiceParent(result)
</span><span class="cx"> if config.Notifications.Services.AMP.Enabled:
</span><span class="cx"> pushSubService = AMPPushForwarder(controlSocketClient)
</span><span class="lines">@@ -959,6 +969,7 @@
</span><span class="cx"> mailRetriever = MailRetriever(
</span><span class="cx"> store, directory, config.Scheduling.iMIP.Receiving
</span><span class="cx"> )
</span><ins>+ mailRetriever.setName("MailRetriever")
</ins><span class="cx"> mailRetriever.setServiceParent(result)
</span><span class="cx"> else:
</span><span class="cx"> mailRetriever = None
</span><span class="lines">@@ -988,37 +999,6 @@
</span><span class="cx"> txn._groupCacher = groupCacher
</span><span class="cx">
</span><span class="cx"> store.callWithNewTransactions(decorateTransaction)
</span><del>-
- # Optionally enable Manhole access
- if config.Manhole.Enabled:
- try:
- from twisted.conch.manhole_tap import (
- makeService as manholeMakeService
- )
- portString = "tcp:{:d}:interface=127.0.0.1".format(
- config.Manhole.StartingPortNumber + int(config.LogID) + 1
- )
- manholeService = manholeMakeService({
- "sshPort": None,
- "telnetPort": portString,
- "namespace": {
- "config": config,
- "service": result,
- "store": store,
- "directory": directory,
- },
- "passwd": config.Manhole.PasswordFilePath,
- })
- manholeService.setServiceParent(result)
- # Using print(because logging isn't ready at this point)
- print("Manhole access enabled:", portString)
-
- except ImportError:
- print(
- "Manhole access could not enabled because "
- "manhole_tap could not be imported"
- )
-
</del><span class="cx"> return result
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -1181,10 +1161,12 @@
</span><span class="cx"> # 'SSL' tag on it, since that's the only time it's used.
</span><span class="cx"> contextFactory = None
</span><span class="cx">
</span><del>- ReportingHTTPService(
</del><ins>+ reportingService = ReportingHTTPService(
</ins><span class="cx"> requestFactory, int(config.MetaFD), contextFactory,
</span><del>- usingSocketFile=config.SocketFiles.Enabled
- ).setServiceParent(connectionService)
</del><ins>+ usingSocketFile=config.SocketFiles.Enabled,
+ )
+ reportingService.setName("http-{}".format(int(config.MetaFD)))
+ reportingService.setServiceParent(connectionService)
</ins><span class="cx">
</span><span class="cx"> else: # Not inheriting, therefore we open our own:
</span><span class="cx"> for bindAddress in self._allBindAddresses():
</span><span class="lines">@@ -1211,6 +1193,8 @@
</span><span class="cx"> backlog=config.ListenBacklog,
</span><span class="cx"> inherit=False
</span><span class="cx"> )
</span><ins>+ httpsService.setName(
+ "https-{}:{}".format(bindAddress,int(port)))
</ins><span class="cx"> httpsService.setServiceParent(connectionService)
</span><span class="cx">
</span><span class="cx"> for port in config.BindHTTPPorts:
</span><span class="lines">@@ -1311,6 +1295,59 @@
</span><span class="cx"> Popen(memcachedArgv)
</span><span class="cx">
</span><span class="cx">
</span><ins>+ def _makeManhole(self, namespace=None, parent=None):
+ try:
+ import inspect
+ import objgraph
+ except ImportError:
+ pass
+ try:
+ if 'inspect' in locals():
+ namespace['ins'] = inspect
+ if 'objgraph' in locals():
+ namespace['og'] = objgraph
+ from pprint import pprint
+ namespace.update({
+ 'pp': pprint,
+ 'cfg': config,
+ })
+ from twisted.conch.manhole_tap import (
+ makeService as manholeMakeService
+ )
+ portOffset = 0 if config.LogID == '' else int(config.LogID) + 1
+ portString = "tcp:{:d}:interface=127.0.0.1".format(
+ config.Manhole.StartingPortNumber + portOffset
+ )
+ manholeService = manholeMakeService({
+ "passwd": config.Manhole.PasswordFilePath,
+ "telnetPort":
+ portString if config.Manhole.UseSSH is False else None,
+ "sshPort":
+ portString if config.Manhole.UseSSH is True else None,
+ "sshKeyDir": config.DataRoot,
+ "sshKeyName": config.Manhole.sshKeyName,
+ "sshKeySize": config.Manhole.sshKeySize,
+ "namespace": namespace,
+ })
+ manholeService.setName("manhole")
+ if parent is not None:
+ manholeService.setServiceParent(parent)
+ # Using print(because logging isn't ready at this point)
+ print("Manhole access enabled:", portString)
+ except ImportError:
+ print(
+ "Manhole access could not enabled because "
+ "manhole_tap could not be imported."
+ )
+ import platform
+ if platform.system() == "Darwin":
+ if config.Manhole.UseSSH:
+ print(
+ "Set Manhole.UseSSH to false or rebuild CS with the "
+ "USE_OPENSSL environment variable set."
+ )
+
+
</ins><span class="cx"> def makeService_Single(self, options):
</span><span class="cx"> """
</span><span class="cx"> Create a service to be used in a single-process, stand-alone
</span><span class="lines">@@ -1332,6 +1369,7 @@
</span><span class="cx"> config.Notifications.Services.APNS, store
</span><span class="cx"> )
</span><span class="cx"> observers.append(pushSubService)
</span><ins>+ pushSubService.setName("APNS")
</ins><span class="cx"> pushSubService.setServiceParent(result)
</span><span class="cx"> if config.Notifications.Services.AMP.Enabled:
</span><span class="cx"> pushSubService = AMPPushMaster(
</span><span class="lines">@@ -1362,6 +1400,7 @@
</span><span class="cx"> mailRetriever = MailRetriever(
</span><span class="cx"> store, directory, config.Scheduling.iMIP.Receiving
</span><span class="cx"> )
</span><ins>+ mailRetriever.setName("mailRetriever")
</ins><span class="cx"> mailRetriever.setServiceParent(result)
</span><span class="cx"> else:
</span><span class="cx"> mailRetriever = None
</span><span class="lines">@@ -1401,35 +1440,6 @@
</span><span class="cx"> else:
</span><span class="cx"> groupCacher = None
</span><span class="cx">
</span><del>- # Optionally enable Manhole access
- if config.Manhole.Enabled:
- try:
- from twisted.conch.manhole_tap import (
- makeService as manholeMakeService
- )
- portString = "tcp:{:d}:interface=127.0.0.1".format(
- config.Manhole.StartingPortNumber
- )
- manholeService = manholeMakeService({
- "sshPort": None,
- "telnetPort": portString,
- "namespace": {
- "config": config,
- "service": result,
- "store": store,
- "directory": directory,
- },
- "passwd": config.Manhole.PasswordFilePath,
- })
- manholeService.setServiceParent(result)
- # Using print(because logging isn't ready at this point)
- print("Manhole access enabled:", portString)
- except ImportError:
- print(
- "Manhole access could not enabled because "
- "manhole_tap could not be imported"
- )
-
</del><span class="cx"> def decorateTransaction(txn):
</span><span class="cx"> txn._pushDistributor = pushDistributor
</span><span class="cx"> txn._rootResource = result.rootResource
</span><span class="lines">@@ -1526,6 +1536,7 @@
</span><span class="cx"> config.ErrorLogMaxRotatedFiles,
</span><span class="cx"> config.ErrorLogRotateOnStart,
</span><span class="cx"> )
</span><ins>+ svc.setName("agent")
</ins><span class="cx"> svc.setServiceParent(agentLoggingService)
</span><span class="cx"> return agentLoggingService
</span><span class="cx">
</span><span class="lines">@@ -1582,6 +1593,7 @@
</span><span class="cx"> dbtype=DatabaseType(dialect, paramstyle, dbfeatures),
</span><span class="cx"> maxConnections=config.MaxDBConnectionsPerPool
</span><span class="cx"> )
</span><ins>+ cp.setName("db")
</ins><span class="cx"> cp.setServiceParent(ms)
</span><span class="cx"> store = storeFromConfigWithoutDPS(config, cp.connection)
</span><span class="cx">
</span><span class="lines">@@ -1655,6 +1667,7 @@
</span><span class="cx"> UpgradeReleaseLockStep(store)
</span><span class="cx"> )
</span><span class="cx">
</span><ins>+ pps.setName("pre")
</ins><span class="cx"> pps.setServiceParent(ms)
</span><span class="cx"> return ms
</span><span class="cx">
</span><span class="lines">@@ -1784,6 +1797,7 @@
</span><span class="cx">
</span><span class="cx"> monitor = DelayedStartupProcessMonitor()
</span><span class="cx"> s.processMonitor = monitor
</span><ins>+ monitor.setName("pm")
</ins><span class="cx"> monitor.setServiceParent(s)
</span><span class="cx">
</span><span class="cx"> if config.MemoryLimiter.Enabled:
</span><span class="lines">@@ -1791,6 +1805,7 @@
</span><span class="cx"> monitor, config.MemoryLimiter.Seconds,
</span><span class="cx"> config.MemoryLimiter.Bytes, config.MemoryLimiter.ResidentOnly
</span><span class="cx"> )
</span><ins>+ memoryLimiter.setName("ml")
</ins><span class="cx"> memoryLimiter.setServiceParent(s)
</span><span class="cx">
</span><span class="cx"> # Maybe spawn memcached through a ProcessMonitor
</span><span class="lines">@@ -1877,32 +1892,6 @@
</span><span class="cx"> statsService.setName("tcp-stats")
</span><span class="cx"> statsService.setServiceParent(s)
</span><span class="cx">
</span><del>- # Optionally enable Manhole access
- if config.Manhole.Enabled:
- try:
- from twisted.conch.manhole_tap import (
- makeService as manholeMakeService
- )
- portString = "tcp:{:d}:interface=127.0.0.1".format(
- config.Manhole.StartingPortNumber
- )
- manholeService = manholeMakeService({
- "sshPort": None,
- "telnetPort": portString,
- "namespace": {
- "config": config,
- "service": s,
- },
- "passwd": config.Manhole.PasswordFilePath,
- })
- manholeService.setServiceParent(s)
- # Using print(because logging isn't ready at this point)
- print("Manhole access enabled:", portString)
- except ImportError:
- print(
- "Manhole access could not enabled because "
- "manhole_tap could not be imported"
- )
</del><span class="cx">
</span><span class="cx">
</span><span class="cx"> # Finally, let's get the real show on the road. Create a service that
</span><span class="lines">@@ -1944,11 +1933,13 @@
</span><span class="cx"> else:
</span><span class="cx"> dispenser = None
</span><span class="cx"> multi = MultiService()
</span><ins>+ multi.setName("multi")
</ins><span class="cx"> pool.setServiceParent(multi)
</span><span class="cx"> spawner = SlaveSpawnerService(
</span><span class="cx"> self, monitor, dispenser, dispatcher, stats, options["config"],
</span><span class="cx"> inheritFDs=inheritFDs, inheritSSLFDs=inheritSSLFDs
</span><span class="cx"> )
</span><ins>+ spawner.setName("spawner")
</ins><span class="cx"> spawner.setServiceParent(multi)
</span><span class="cx"> if config.UseMetaFD:
</span><span class="cx"> cl.setServiceParent(multi)
</span><span class="lines">@@ -1961,6 +1952,7 @@
</span><span class="cx"> mailRetriever = MailRetriever(
</span><span class="cx"> store, directory, config.Scheduling.iMIP.Receiving
</span><span class="cx"> )
</span><ins>+ mailRetriever.setName("MailRetriever")
</ins><span class="cx"> mailRetriever.setServiceParent(multi)
</span><span class="cx"> else:
</span><span class="cx"> mailRetriever = None
</span><span class="lines">@@ -1993,6 +1985,7 @@
</span><span class="cx"> ssvc = self.storageService(
</span><span class="cx"> spawnerSvcCreator, None, uid, gid
</span><span class="cx"> )
</span><ins>+ ssvc.setName("ssvc")
</ins><span class="cx"> ssvc.setServiceParent(s)
</span><span class="cx"> return s
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboobetternextjobcalendarservertoolsgatewaypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/better-next-job/calendarserver/tools/gateway.py (15760 => 15761)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/better-next-job/calendarserver/tools/gateway.py        2016-07-13 02:18:08 UTC (rev 15760)
+++ CalendarServer/branches/users/cdaboo/better-next-job/calendarserver/tools/gateway.py        2016-07-13 02:23:31 UTC (rev 15761)
</span><span class="lines">@@ -35,16 +35,14 @@
</span><span class="cx"> WRITABLE_CONFIG_KEYS, setKeyPath, getKeyPath, flattenDictionary,
</span><span class="cx"> WritableConfig
</span><span class="cx"> )
</span><del>-from calendarserver.tools.principals import (
- getProxies, setProxies
-)
</del><span class="cx"> from calendarserver.tools.purge import (
</span><span class="cx"> WorkerService, PurgeOldEventsService,
</span><span class="cx"> DEFAULT_BATCH_SIZE, DEFAULT_RETAIN_DAYS,
</span><span class="cx"> PrincipalPurgeWork
</span><span class="cx"> )
</span><span class="cx"> from calendarserver.tools.util import (
</span><del>- recordForPrincipalID, autoDisableMemcached
</del><ins>+ recordForPrincipalID, autoDisableMemcached,
+ getProxies, setProxies
</ins><span class="cx"> )
</span><span class="cx"> from pycalendar.datetime import DateTime
</span><span class="cx"> from twext.who.directory import DirectoryRecord
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboobetternextjobcalendarservertoolsprincipalspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/better-next-job/calendarserver/tools/principals.py (15760 => 15761)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/better-next-job/calendarserver/tools/principals.py        2016-07-13 02:18:08 UTC (rev 15760)
+++ CalendarServer/branches/users/cdaboo/better-next-job/calendarserver/tools/principals.py        2016-07-13 02:23:31 UTC (rev 15761)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx">
</span><span class="cx"> from calendarserver.tools.cmdline import utilityMain, WorkerService
</span><span class="cx"> from calendarserver.tools.util import (
</span><del>- recordForPrincipalID, prettyRecord
</del><ins>+ recordForPrincipalID, prettyRecord, action_addProxy, action_removeProxy
</ins><span class="cx"> )
</span><span class="cx"> from twext.who.directory import DirectoryRecord
</span><span class="cx"> from twext.who.idirectory import RecordType, InvalidDirectoryRecordError
</span><span class="lines">@@ -40,8 +40,7 @@
</span><span class="cx"> from twisted.internet.defer import inlineCallbacks, returnValue, succeed
</span><span class="cx"> from twistedcaldav.config import config
</span><span class="cx"> from twistedcaldav.cache import MemcacheChangeNotifier
</span><del>-from txdav.who.delegates import Delegates, RecordType as DelegateRecordType, \
- CachingDelegates
</del><ins>+from txdav.who.delegates import CachingDelegates
</ins><span class="cx"> from txdav.who.idirectory import AutoScheduleMode
</span><span class="cx"> from txdav.who.groups import GroupCacherPollingWork
</span><span class="cx">
</span><span class="lines">@@ -604,108 +603,11 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span><del>-@inlineCallbacks
-def _addRemoveProxy(msg, fn, store, record, proxyType, *proxyIDs):
- directory = store.directoryService()
- readWrite = (proxyType == "write")
- for proxyID in proxyIDs:
- proxyRecord = yield recordForPrincipalID(directory, proxyID)
- if proxyRecord is None:
- print("Invalid principal ID: %s" % (proxyID,))
- else:
- txn = store.newTransaction()
- yield fn(txn, record, proxyRecord, readWrite)
- yield txn.commit()
- print(
- "{msg} {proxy} as a {proxyType} proxy for {record}".format(
- msg=msg, proxy=prettyRecord(proxyRecord),
- proxyType=proxyType, record=prettyRecord(record)
- )
- )
</del><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span><del>-@inlineCallbacks
-def action_addProxy(store, record, proxyType, *proxyIDs):
- if config.GroupCaching.Enabled and config.GroupCaching.UseDirectoryBasedDelegates:
- if record.recordType in (
- record.service.recordType.location,
- record.service.recordType.resource,
- ):
- print("You are not allowed to add proxies for locations or resources via command line when their proxy assignments come from the directory service.")
- returnValue(None)
</del><span class="cx">
</span><del>- yield _addRemoveProxy("Added", Delegates.addDelegate, store, record, proxyType, *proxyIDs)
-
-
-
</del><span class="cx"> @inlineCallbacks
</span><del>-def action_removeProxy(store, record, *proxyIDs):
- if config.GroupCaching.Enabled and config.GroupCaching.UseDirectoryBasedDelegates:
- if record.recordType in (
- record.service.recordType.location,
- record.service.recordType.resource,
- ):
- print("You are not allowed to remove proxies for locations or resources via command line when their proxy assignments come from the directory service.")
- returnValue(None)
-
- # Write
- yield _addRemoveProxy("Removed", Delegates.removeDelegate, store, record, "write", *proxyIDs)
- # Read
- yield _addRemoveProxy("Removed", Delegates.removeDelegate, store, record, "read", *proxyIDs)
-
-
-
-@inlineCallbacks
-def setProxies(record, readProxyRecords, writeProxyRecords):
- """
- Set read/write proxies en masse for a record
- @param record: L{IDirectoryRecord}
- @param readProxyRecords: a list of records
- @param writeProxyRecords: a list of records
- """
-
- proxyTypes = [
- (DelegateRecordType.readDelegateGroup, readProxyRecords),
- (DelegateRecordType.writeDelegateGroup, writeProxyRecords),
- ]
- for recordType, proxyRecords in proxyTypes:
- if proxyRecords is None:
- continue
- proxyGroup = yield record.service.recordWithShortName(
- recordType, record.uid
- )
- yield proxyGroup.setMembers(proxyRecords)
-
-
-
-@inlineCallbacks
-def getProxies(record):
- """
- Returns a tuple containing the records for read proxies and write proxies
- of the given record
- """
-
- allProxies = {
- DelegateRecordType.readDelegateGroup: [],
- DelegateRecordType.writeDelegateGroup: [],
- }
- for recordType in allProxies.iterkeys():
- proxyGroup = yield record.service.recordWithShortName(
- recordType, record.uid
- )
- allProxies[recordType] = yield proxyGroup.members()
-
- returnValue(
- (
- allProxies[DelegateRecordType.readDelegateGroup],
- allProxies[DelegateRecordType.writeDelegateGroup]
- )
- )
-
-
-
-@inlineCallbacks
</del><span class="cx"> def action_listGroupMembers(store, record):
</span><span class="cx"> members = yield record.members()
</span><span class="cx"> if members:
</span><span class="lines">@@ -871,17 +773,10 @@
</span><span class="cx"> )
</span><span class="cx"> )
</span><span class="cx">
</span><del>- # Get original fields
- newFields = record.fields.copy()
</del><ins>+ yield record.setAutoScheduleMode(autoScheduleMode)
</ins><span class="cx">
</span><del>- # Set new values
- newFields[record.service.fieldName.autoScheduleMode] = autoScheduleMode
</del><span class="cx">
</span><del>- updatedRecord = DirectoryRecord(record.service, newFields)
- yield record.service.updateRecords([updatedRecord], create=False)
</del><span class="cx">
</span><del>-
-
</del><span class="cx"> @inlineCallbacks
</span><span class="cx"> def action_setAutoAcceptGroup(store, record, autoAcceptGroup):
</span><span class="cx"> if record.recordType == RecordType.group:
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboobetternextjobcalendarservertoolstesttest_principalspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/better-next-job/calendarserver/tools/test/test_principals.py (15760 => 15761)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/better-next-job/calendarserver/tools/test/test_principals.py        2016-07-13 02:18:08 UTC (rev 15760)
+++ CalendarServer/branches/users/cdaboo/better-next-job/calendarserver/tools/test/test_principals.py        2016-07-13 02:23:31 UTC (rev 15761)
</span><span class="lines">@@ -19,8 +19,11 @@
</span><span class="cx"> from twistedcaldav.stdconfig import config
</span><span class="cx"> from calendarserver.tools.principals import (
</span><span class="cx"> parseCreationArgs, matchStrings,
</span><del>- recordForPrincipalID, getProxies, setProxies
</del><ins>+ recordForPrincipalID
</ins><span class="cx"> )
</span><ins>+from calendarserver.tools.util import (
+ getProxies, setProxies
+)
</ins><span class="cx"> from twext.python.filepath import CachingFilePath as FilePath
</span><span class="cx"> from twisted.internet import reactor
</span><span class="cx"> from twisted.internet.defer import inlineCallbacks, Deferred, returnValue
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboobetternextjobcalendarservertoolsutilpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/better-next-job/calendarserver/tools/util.py (15760 => 15761)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/better-next-job/calendarserver/tools/util.py        2016-07-13 02:18:08 UTC (rev 15760)
+++ CalendarServer/branches/users/cdaboo/better-next-job/calendarserver/tools/util.py        2016-07-13 02:23:31 UTC (rev 15761)
</span><span class="lines">@@ -30,7 +30,6 @@
</span><span class="cx"> import socket
</span><span class="cx"> from pwd import getpwnam
</span><span class="cx"> from grp import getgrnam
</span><del>-from uuid import UUID
</del><span class="cx">
</span><span class="cx"> from calendarserver.tools import diagnose
</span><span class="cx">
</span><span class="lines">@@ -41,9 +40,6 @@
</span><span class="cx"> from twext.python.log import Logger
</span><span class="cx"> from twisted.internet.defer import inlineCallbacks, returnValue
</span><span class="cx">
</span><del>-from txdav.xml import element as davxml
-
-
</del><span class="cx"> from twistedcaldav import memcachepool
</span><span class="cx"> from txdav.base.propertystore.base import PropertyName
</span><span class="cx"> from txdav.xml import element
</span><span class="lines">@@ -52,7 +48,9 @@
</span><span class="cx"> from twext.who.idirectory import RecordType
</span><span class="cx"> from txdav.who.idirectory import RecordType as CalRecordType
</span><span class="cx">
</span><ins>+from txdav.who.delegates import Delegates, RecordType as DelegateRecordType
</ins><span class="cx">
</span><ins>+
</ins><span class="cx"> log = Logger()
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -272,8 +270,6 @@
</span><span class="cx"> returnValue((yield directory.principalCollection.principalForShortName(recordType, shortName)))
</span><span class="cx">
</span><span class="cx"> try:
</span><del>- UUID(principalID)
-
</del><span class="cx"> if checkOnly:
</span><span class="cx"> returnValue(None)
</span><span class="cx">
</span><span class="lines">@@ -343,129 +339,110 @@
</span><span class="cx"> raise ValueError("Invalid principal identifier: %s" % (principalID,))
</span><span class="cx">
</span><span class="cx">
</span><ins>+@inlineCallbacks
+def _addRemoveProxy(msg, fn, store, record, proxyType, *proxyIDs):
+ directory = store.directoryService()
+ readWrite = (proxyType == "write")
+ for proxyID in proxyIDs:
+ proxyRecord = yield recordForPrincipalID(directory, proxyID)
+ if proxyRecord is None:
+ print("Invalid principal ID: %s" % (proxyID,))
+ else:
+ txn = store.newTransaction()
+ yield fn(txn, record, proxyRecord, readWrite)
+ yield txn.commit()
+ print(
+ "{msg} {proxy} as a {proxyType} proxy for {record}".format(
+ msg=msg, proxy=prettyRecord(proxyRecord),
+ proxyType=proxyType, record=prettyRecord(record)
+ )
+ )
</ins><span class="cx">
</span><del>-def proxySubprincipal(principal, proxyType):
- return principal.getChild("calendar-proxy-" + proxyType)
</del><span class="cx">
</span><span class="cx">
</span><del>-
</del><span class="cx"> @inlineCallbacks
</span><del>-def action_addProxyPrincipal(rootResource, directory, store, principal, proxyType, proxyPrincipal):
- try:
- (yield addProxy(rootResource, directory, store, principal, proxyType, proxyPrincipal))
- print("Added %s as a %s proxy for %s" % (
- prettyPrincipal(proxyPrincipal), proxyType,
- prettyPrincipal(principal)))
- except ProxyError, e:
- print("Error:", e)
- except ProxyWarning, e:
- print(e)
</del><ins>+def action_addProxy(store, record, proxyType, *proxyIDs):
+ if config.GroupCaching.Enabled and config.GroupCaching.UseDirectoryBasedDelegates:
+ if record.recordType in (
+ record.service.recordType.location,
+ record.service.recordType.resource,
+ ):
+ print("You are not allowed to add proxies for locations or resources via command line when their proxy assignments come from the directory service.")
+ returnValue(None)
</ins><span class="cx">
</span><ins>+ yield _addRemoveProxy("Added", Delegates.addDelegate, store, record, proxyType, *proxyIDs)
</ins><span class="cx">
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> @inlineCallbacks
</span><del>-def action_removeProxyPrincipal(rootResource, directory, store, principal, proxyPrincipal, **kwargs):
- try:
- removed = (yield removeProxy(
- rootResource, directory, store,
- principal, proxyPrincipal, **kwargs
- ))
- if removed:
- print("Removed %s as a proxy for %s" % (
- prettyPrincipal(proxyPrincipal),
- prettyPrincipal(principal)))
- except ProxyError, e:
- print("Error:", e)
- except ProxyWarning, e:
- print(e)
</del><ins>+def action_removeProxy(store, record, *proxyIDs):
+ if config.GroupCaching.Enabled and config.GroupCaching.UseDirectoryBasedDelegates:
+ if record.recordType in (
+ record.service.recordType.location,
+ record.service.recordType.resource,
+ ):
+ print("You are not allowed to remove proxies for locations or resources via command line when their proxy assignments come from the directory service.")
+ returnValue(None)
</ins><span class="cx">
</span><ins>+ # Write
+ yield _addRemoveProxy("Removed", Delegates.removeDelegate, store, record, "write", *proxyIDs)
+ # Read
+ yield _addRemoveProxy("Removed", Delegates.removeDelegate, store, record, "read", *proxyIDs)
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> @inlineCallbacks
</span><del>-def addProxy(rootResource, directory, store, principal, proxyType, proxyPrincipal):
- proxyURL = proxyPrincipal.url()
</del><ins>+def setProxies(record, readProxyRecords, writeProxyRecords):
+ """
+ Set read/write proxies en masse for a record
+ @param record: L{IDirectoryRecord}
+ @param readProxyRecords: a list of records
+ @param writeProxyRecords: a list of records
+ """
</ins><span class="cx">
</span><del>- subPrincipal = yield proxySubprincipal(principal, proxyType)
- if subPrincipal is None:
- raise ProxyError(
- "Unable to edit %s proxies for %s\n" % (
- proxyType,
- prettyPrincipal(principal)
- )
</del><ins>+ proxyTypes = [
+ (DelegateRecordType.readDelegateGroup, readProxyRecords),
+ (DelegateRecordType.writeDelegateGroup, writeProxyRecords),
+ ]
+ for recordType, proxyRecords in proxyTypes:
+ if proxyRecords is None:
+ continue
+ proxyGroup = yield record.service.recordWithShortName(
+ recordType, record.uid
</ins><span class="cx"> )
</span><ins>+ yield proxyGroup.setMembers(proxyRecords)
</ins><span class="cx">
</span><del>- membersProperty = (yield subPrincipal.readProperty(davxml.GroupMemberSet, None))
</del><span class="cx">
</span><del>- for memberURL in membersProperty.children:
- if str(memberURL) == proxyURL:
- raise ProxyWarning("%s is already a %s proxy for %s" % (
- prettyPrincipal(proxyPrincipal), proxyType,
- prettyPrincipal(principal)))
</del><span class="cx">
</span><del>- else:
- memberURLs = list(membersProperty.children)
- memberURLs.append(davxml.HRef(proxyURL))
- membersProperty = davxml.GroupMemberSet(*memberURLs)
- (yield subPrincipal.writeProperty(membersProperty, None))
</del><ins>+@inlineCallbacks
+def getProxies(record):
+ """
+ Returns a tuple containing the records for read proxies and write proxies
+ of the given record
+ """
</ins><span class="cx">
</span><del>- proxyTypes = ["read", "write"]
- proxyTypes.remove(proxyType)
</del><ins>+ allProxies = {
+ DelegateRecordType.readDelegateGroup: [],
+ DelegateRecordType.writeDelegateGroup: [],
+ }
+ for recordType in allProxies.iterkeys():
+ proxyGroup = yield record.service.recordWithShortName(
+ recordType, record.uid
+ )
+ allProxies[recordType] = yield proxyGroup.members()
</ins><span class="cx">
</span><del>- yield action_removeProxyPrincipal(
- rootResource, directory, store,
- principal, proxyPrincipal, proxyTypes=proxyTypes
</del><ins>+ returnValue(
+ (
+ allProxies[DelegateRecordType.readDelegateGroup],
+ allProxies[DelegateRecordType.writeDelegateGroup]
+ )
</ins><span class="cx"> )
</span><span class="cx">
</span><del>- # Schedule work the PeerConnectionPool will pick up as overdue
- def groupPollNow(txn):
- from txdav.who.groups import GroupCacherPollingWork
- return GroupCacherPollingWork.reschedule(txn, 0, force=True)
- yield store.inTransaction("addProxy groupPollNow", groupPollNow)
</del><span class="cx">
</span><ins>+def proxySubprincipal(principal, proxyType):
+ return principal.getChild("calendar-proxy-" + proxyType)
</ins><span class="cx">
</span><span class="cx">
</span><del>-@inlineCallbacks
-def removeProxy(rootResource, directory, store, principal, proxyPrincipal, **kwargs):
- removed = False
- proxyTypes = kwargs.get("proxyTypes", ("read", "write"))
- for proxyType in proxyTypes:
- proxyURL = proxyPrincipal.url()
</del><span class="cx">
</span><del>- subPrincipal = yield proxySubprincipal(principal, proxyType)
- if subPrincipal is None:
- raise ProxyError(
- "Unable to edit %s proxies for %s\n" % (
- proxyType,
- prettyPrincipal(principal)
- )
- )
-
- membersProperty = (yield subPrincipal.readProperty(davxml.GroupMemberSet, None))
-
- memberURLs = [
- m for m in membersProperty.children
- if str(m) != proxyURL
- ]
-
- if len(memberURLs) == len(membersProperty.children):
- # No change
- continue
- else:
- removed = True
-
- membersProperty = davxml.GroupMemberSet(*memberURLs)
- (yield subPrincipal.writeProperty(membersProperty, None))
-
- if removed:
- # Schedule work the PeerConnectionPool will pick up as overdue
- def groupPollNow(txn):
- from txdav.who.groups import GroupCacherPollingWork
- return GroupCacherPollingWork.reschedule(txn, 0, force=True)
- yield store.inTransaction("removeProxy groupPollNow", groupPollNow)
- returnValue(removed)
-
-
-
</del><span class="cx"> def prettyPrincipal(principal):
</span><span class="cx"> return prettyRecord(principal.record)
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboobetternextjobcalendarserverwebadmindelegationpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/better-next-job/calendarserver/webadmin/delegation.py (15760 => 15761)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/better-next-job/calendarserver/webadmin/delegation.py        2016-07-13 02:18:08 UTC (rev 15760)
+++ CalendarServer/branches/users/cdaboo/better-next-job/calendarserver/webadmin/delegation.py        2016-07-13 02:23:31 UTC (rev 15761)
</span><span class="lines">@@ -27,8 +27,8 @@
</span><span class="cx"> import urlparse
</span><span class="cx">
</span><span class="cx"> from calendarserver.tools.util import (
</span><del>- principalForPrincipalID, proxySubprincipal, action_addProxyPrincipal,
- action_removeProxyPrincipal
</del><ins>+ recordForPrincipalID, proxySubprincipal, action_addProxy,
+ action_removeProxy, principalForPrincipalID
</ins><span class="cx"> )
</span><span class="cx">
</span><span class="cx"> from twistedcaldav.config import config
</span><span class="lines">@@ -49,6 +49,15 @@
</span><span class="cx"> from twext.who.idirectory import RecordType
</span><span class="cx"> from txdav.who.idirectory import RecordType as CalRecordType, AutoScheduleMode
</span><span class="cx">
</span><ins>+allowedAutoScheduleModes = {
+ "default": None,
+ "none": AutoScheduleMode.none,
+ "accept-always": AutoScheduleMode.accept,
+ "decline-always": AutoScheduleMode.decline,
+ "accept-if-free": AutoScheduleMode.acceptIfFree,
+ "decline-if-busy": AutoScheduleMode.declineIfBusy,
+ "automatic": AutoScheduleMode.acceptIfFreeDeclineIfBusy,
+}
</ins><span class="cx">
</span><span class="cx"> class WebAdminPage(Element):
</span><span class="cx"> """
</span><span class="lines">@@ -221,8 +230,8 @@
</span><span class="cx"> self.principalResource = principalResource
</span><span class="cx"> self.adminResource = adminResource
</span><span class="cx"> self.proxySearch = proxySearch
</span><del>- record = principalResource.record
- tag.fillSlots(resourceTitle=recordTitle(record),
</del><ins>+ self.record = principalResource.record
+ tag.fillSlots(resourceTitle=recordTitle(self.record),
</ins><span class="cx"> resourceId=resourceId,
</span><span class="cx"> davPropertyName=davPropertyName,
</span><span class="cx"> proxySearch=proxySearch)
</span><span class="lines">@@ -283,9 +292,9 @@
</span><span class="cx"> Renderer which elides its tag for non-resource-type principals.
</span><span class="cx"> """
</span><span class="cx"> if (
</span><del>- self.principalResource.record.recordType.description != "user" and
- self.principalResource.record.recordType.description != "group" or
- self.principalResource.record.recordType.description == "user" and
</del><ins>+ self.record.recordType.description != "user" and
+ self.record.recordType.description != "group" or
+ self.record.recordType.description == "user" and
</ins><span class="cx"> config.Scheduling.Options.AutoSchedule.AllowUsers
</span><span class="cx"> ):
</span><span class="cx"> return tag
</span><span class="lines">@@ -293,99 +302,91 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> @renderer
</span><del>- @inlineCallbacks
</del><span class="cx"> def isAutoSchedule(self, request, tag):
</span><span class="cx"> """
</span><span class="cx"> Renderer which sets the 'selected' attribute on its tag if the resource
</span><span class="cx"> is auto-schedule.
</span><span class="cx"> """
</span><del>- if (yield self.principalResource.getAutoScheduleMode()) is not AutoScheduleMode.none:
</del><ins>+ if self.record.autoScheduleMode is not AutoScheduleMode.none:
</ins><span class="cx"> tag(selected='selected')
</span><del>- returnValue(tag)
</del><ins>+ return tag
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> @renderer
</span><del>- @inlineCallbacks
</del><span class="cx"> def isntAutoSchedule(self, request, tag):
</span><span class="cx"> """
</span><span class="cx"> Renderer which sets the 'selected' attribute on its tag if the resource
</span><span class="cx"> is not auto-schedule.
</span><span class="cx"> """
</span><del>- if (yield self.principalResource.getAutoScheduleMode()) is AutoScheduleMode.none:
</del><ins>+ if self.record.autoScheduleMode is AutoScheduleMode.none:
</ins><span class="cx"> tag(selected='selected')
</span><del>- returnValue(tag)
</del><ins>+ return tag
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> @renderer
</span><del>- @inlineCallbacks
</del><span class="cx"> def autoScheduleModeNone(self, request, tag):
</span><span class="cx"> """
</span><span class="cx"> Renderer which sets the 'selected' attribute on its tag based on the resource
</span><span class="cx"> auto-schedule-mode.
</span><span class="cx"> """
</span><del>- if (yield self.principalResource.getAutoScheduleMode()) is AutoScheduleMode.none:
</del><ins>+ if self.record.autoScheduleMode is AutoScheduleMode.none:
</ins><span class="cx"> tag(selected='selected')
</span><del>- returnValue(tag)
</del><ins>+ return tag
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> @renderer
</span><del>- @inlineCallbacks
</del><span class="cx"> def autoScheduleModeAcceptAlways(self, request, tag):
</span><span class="cx"> """
</span><span class="cx"> Renderer which sets the 'selected' attribute on its tag based on the resource
</span><span class="cx"> auto-schedule-mode.
</span><span class="cx"> """
</span><del>- if (yield self.principalResource.getAutoScheduleMode()) is AutoScheduleMode.accept:
</del><ins>+ if self.record.autoScheduleMode is AutoScheduleMode.accept:
</ins><span class="cx"> tag(selected='selected')
</span><del>- returnValue(tag)
</del><ins>+ return tag
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> @renderer
</span><del>- @inlineCallbacks
</del><span class="cx"> def autoScheduleModeDeclineAlways(self, request, tag):
</span><span class="cx"> """
</span><span class="cx"> Renderer which sets the 'selected' attribute on its tag based on the resource
</span><span class="cx"> auto-schedule-mode.
</span><span class="cx"> """
</span><del>- if (yield self.principalResource.getAutoScheduleMode()) is AutoScheduleMode.decline:
</del><ins>+ if self.record.autoScheduleMode is AutoScheduleMode.decline:
</ins><span class="cx"> tag(selected='selected')
</span><del>- returnValue(tag)
</del><ins>+ return tag
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> @renderer
</span><del>- @inlineCallbacks
</del><span class="cx"> def autoScheduleModeAcceptIfFree(self, request, tag):
</span><span class="cx"> """
</span><span class="cx"> Renderer which sets the 'selected' attribute on its tag based on the resource
</span><span class="cx"> auto-schedule-mode.
</span><span class="cx"> """
</span><del>- if (yield self.principalResource.getAutoScheduleMode()) is AutoScheduleMode.acceptIfFree:
</del><ins>+ if self.record.autoScheduleMode is AutoScheduleMode.acceptIfFree:
</ins><span class="cx"> tag(selected='selected')
</span><del>- returnValue(tag)
</del><ins>+ return tag
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> @renderer
</span><del>- @inlineCallbacks
</del><span class="cx"> def autoScheduleModeDeclineIfBusy(self, request, tag):
</span><span class="cx"> """
</span><span class="cx"> Renderer which sets the 'selected' attribute on its tag based on the resource
</span><span class="cx"> auto-schedule-mode.
</span><span class="cx"> """
</span><del>- if (yield self.principalResource.getAutoScheduleMode()) is AutoScheduleMode.declineIfBusy:
</del><ins>+ if self.record.autoScheduleMode is AutoScheduleMode.declineIfBusy:
</ins><span class="cx"> tag(selected='selected')
</span><del>- returnValue(tag)
</del><ins>+ return tag
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> @renderer
</span><del>- @inlineCallbacks
</del><span class="cx"> def autoScheduleModeAutomatic(self, request, tag):
</span><span class="cx"> """
</span><span class="cx"> Renderer which sets the 'selected' attribute on its tag based on the resource
</span><span class="cx"> auto-schedule-mode.
</span><span class="cx"> """
</span><del>- if (yield self.principalResource.getAutoScheduleMode()) is AutoScheduleMode.acceptIfFreeDeclineIfBusy:
</del><ins>+ if self.record.autoScheduleMode is AutoScheduleMode.acceptIfFreeDeclineIfBusy:
</ins><span class="cx"> tag(selected='selected')
</span><del>- returnValue(tag)
</del><ins>+ return tag
</ins><span class="cx">
</span><span class="cx"> _matrix = None
</span><span class="cx">
</span><span class="lines">@@ -634,9 +635,9 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> @inlineCallbacks
</span><del>- def resourceActions(self, request, principal):
</del><ins>+ def resourceActions(self, request, record):
</ins><span class="cx"> """
</span><del>- Take all actions on the given principal based on the given request.
</del><ins>+ Take all actions on the given record based on the given request.
</ins><span class="cx"> """
</span><span class="cx">
</span><span class="cx"> def queryValue(arg):
</span><span class="lines">@@ -651,45 +652,32 @@
</span><span class="cx"> matches.append(key[len(arg):])
</span><span class="cx"> return matches
</span><span class="cx">
</span><del>- autoSchedule = queryValue("autoSchedule")
</del><span class="cx"> autoScheduleMode = queryValue("autoScheduleMode")
</span><span class="cx"> makeReadProxies = queryValues("mkReadProxy|")
</span><span class="cx"> makeWriteProxies = queryValues("mkWriteProxy|")
</span><span class="cx"> removeProxies = queryValues("rmProxy|")
</span><span class="cx">
</span><del>- # Update the auto-schedule value if specified.
- if autoSchedule is not None and (autoSchedule == "true" or
- autoSchedule == "false"):
</del><ins>+ # Update the auto-schedule-mode value if specified.
+ if autoScheduleMode:
</ins><span class="cx"> if (
</span><del>- principal.record.recordType != RecordType.user and
- principal.record.recordType != RecordType.group or
- principal.record.recordType == RecordType.user and
</del><ins>+ record.recordType != RecordType.user and
+ record.recordType != RecordType.group or
+ record.recordType == RecordType.user and
</ins><span class="cx"> config.Scheduling.Options.AutoSchedule.AllowUsers
</span><span class="cx"> ):
</span><del>- (yield principal.setAutoSchedule(autoSchedule == "true"))
- (yield principal.setAutoScheduleMode(autoScheduleMode))
</del><ins>+ autoScheduleMode = allowedAutoScheduleModes[autoScheduleMode]
+ yield record.setAutoScheduleMode(autoScheduleMode)
+ record.autoScheduleMode = autoScheduleMode
</ins><span class="cx">
</span><span class="cx"> # Update the proxies if specified.
</span><del>- for proxyId in removeProxies:
- proxy = yield self.getResourceById(request, proxyId)
- yield action_removeProxyPrincipal(
- self.root, self.directory, self.store,
- principal, proxy, proxyTypes=["read", "write"]
- )
</del><ins>+ if removeProxies:
+ yield action_removeProxy(self.store, record, *removeProxies)
</ins><span class="cx">
</span><del>- for proxyId in makeReadProxies:
- proxy = yield self.getResourceById(request, proxyId)
- yield action_addProxyPrincipal(
- self.root, self.directory, self.store,
- principal, "read", proxy
- )
</del><ins>+ if makeReadProxies:
+ yield action_addProxy(self.store, record, "read", *makeReadProxies)
</ins><span class="cx">
</span><del>- for proxyId in makeWriteProxies:
- proxy = yield self.getResourceById(request, proxyId)
- yield action_addProxyPrincipal(
- self.root, self.directory, self.store,
- principal, "write", proxy
- )
</del><ins>+ if makeWriteProxies:
+ yield action_addProxy(self.store, record, "write", *makeWriteProxies)
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> @inlineCallbacks
</span><span class="lines">@@ -700,8 +688,8 @@
</span><span class="cx"> """
</span><span class="cx"> resourceId = request.args.get('resourceId', [''])[0]
</span><span class="cx"> if resourceId:
</span><del>- principal = yield self.getResourceById(request, resourceId)
- yield self.resourceActions(request, principal)
</del><ins>+ record = yield recordForPrincipalID(self.directory, resourceId)
+ yield self.resourceActions(request, record)
</ins><span class="cx"> htmlContent = yield flattenString(request, WebAdminPage(self))
</span><span class="cx"> response = Response()
</span><span class="cx"> response.stream = MemoryStream(htmlContent)
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboobetternextjobconfcaldavdstdconfigplist"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/better-next-job/conf/caldavd-stdconfig.plist (15760 => 15761)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/better-next-job/conf/caldavd-stdconfig.plist        2016-07-13 02:18:08 UTC (rev 15760)
+++ CalendarServer/branches/users/cdaboo/better-next-job/conf/caldavd-stdconfig.plist        2016-07-13 02:23:31 UTC (rev 15761)
</span><span class="lines">@@ -2123,14 +2123,28 @@
</span><span class="cx">                 <key>Enabled</key>
</span><span class="cx">                 <false/>
</span><span class="cx">
</span><ins>+                <!-- Set to False for telnet -->
+                <key>UseSSH</key>
+                <true/>
+
+                <!-- Master listens here, children increment -->
</ins><span class="cx">                 <key>StartingPortNumber</key>
</span><span class="cx">                 <integer>5000</integer>
</span><span class="cx">
</span><ins>+                <!-- Directory Proxy listens here -->
</ins><span class="cx">                 <key>DPSPortNumber</key>
</span><span class="cx">                 <integer>4999</integer>
</span><span class="cx">
</span><ins>+                <!-- Path to password file with lines of user:pass -->
</ins><span class="cx">                 <key>PasswordFilePath</key>
</span><span class="cx">                 <string></string>
</span><ins>+
+                <!-- Relative to DataRoot -->
+                <key>sshKeyName</key>
+                <string>manhole.key</string>
+
+                <key>sshKeySize</key>
+                <integer>4096</integer>
</ins><span class="cx">         </dict>
</span><span class="cx">
</span><span class="cx">         <key>EnableKeepAlive</key>
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboobetternextjobtwistedcaldavstdconfigpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/better-next-job/twistedcaldav/stdconfig.py (15760 => 15761)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/better-next-job/twistedcaldav/stdconfig.py        2016-07-13 02:18:08 UTC (rev 15760)
+++ CalendarServer/branches/users/cdaboo/better-next-job/twistedcaldav/stdconfig.py        2016-07-13 02:23:31 UTC (rev 15761)
</span><span class="lines">@@ -1108,9 +1108,12 @@
</span><span class="cx">
</span><span class="cx"> "Manhole": {
</span><span class="cx"> "Enabled": False,
</span><del>- "StartingPortNumber": 5000,
- "DPSPortNumber": 4999,
- "PasswordFilePath": "",
</del><ins>+ "UseSSH": True, # Set to False for telnet
+ "StartingPortNumber": 5000, # Master listens here, children increment
+ "DPSPortNumber": 4999, # Directory Proxy listens here
+ "PasswordFilePath": "", # Path to password file with lines of user:pass
+ "sshKeyName": "manhole.key", # Relative to DataRoot
+ "sshKeySize": 4096,
</ins><span class="cx"> },
</span><span class="cx">
</span><span class="cx"> "EnableKeepAlive": False,
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboobetternextjobtxdavcaldavicalendardirectoryservicepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/better-next-job/txdav/caldav/icalendardirectoryservice.py (15760 => 15761)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/better-next-job/txdav/caldav/icalendardirectoryservice.py        2016-07-13 02:18:08 UTC (rev 15760)
+++ CalendarServer/branches/users/cdaboo/better-next-job/txdav/caldav/icalendardirectoryservice.py        2016-07-13 02:23:31 UTC (rev 15761)
</span><span class="lines">@@ -106,6 +106,15 @@
</span><span class="cx"> @rtype: C{bool}
</span><span class="cx"> """
</span><span class="cx">
</span><ins>+ def setAutoScheduleMode(autoScheduleMode): #@NoSelf
+ """
+ Sets the mode of automatic scheduling used for this record.
+
+ @param autoScheduleMode: the new mode
+ @type autoScheduleMode: L{AutoScheduleMode}
+ """
+
+
</ins><span class="cx"> def isProxyFor(other): #@NoSelf
</span><span class="cx"> """
</span><span class="cx"> Test whether the record is a calendar user proxy for the specified record.
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboobetternextjobtxdavdpsclientpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/better-next-job/txdav/dps/client.py (15760 => 15761)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/better-next-job/txdav/dps/client.py        2016-07-13 02:18:08 UTC (rev 15760)
+++ CalendarServer/branches/users/cdaboo/better-next-job/txdav/dps/client.py        2016-07-13 02:23:31 UTC (rev 15761)
</span><span class="lines">@@ -44,7 +44,8 @@
</span><span class="cx"> WikiAccessForUIDCommand, ContinuationCommand,
</span><span class="cx"> StatsCommand, ExternalDelegatesCommand, ExpandedMemberUIDsCommand,
</span><span class="cx"> AddMembersCommand, RemoveMembersCommand,
</span><del>- UpdateRecordsCommand, ExpandedMembersCommand, FlushCommand
</del><ins>+ UpdateRecordsCommand, ExpandedMembersCommand, FlushCommand,
+ SetAutoScheduleModeCommand
</ins><span class="cx"> )
</span><span class="cx"> from txdav.who.delegates import RecordType as DelegatesRecordType
</span><span class="cx"> from txdav.who.directory import (
</span><span class="lines">@@ -422,6 +423,14 @@
</span><span class="cx"> )
</span><span class="cx">
</span><span class="cx">
</span><ins>+ def setAutoScheduleMode(self, record, autoScheduleMode):
+ return self._sendCommand(
+ SetAutoScheduleModeCommand,
+ uid=record.uid.encode("utf-8"),
+ autoScheduleMode=autoScheduleMode.name,
+ )
+
+
</ins><span class="cx"> @inlineCallbacks
</span><span class="cx"> def flush(self):
</span><span class="cx"> try:
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboobetternextjobtxdavdpscommandspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/better-next-job/txdav/dps/commands.py (15760 => 15761)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/better-next-job/txdav/dps/commands.py        2016-07-13 02:18:08 UTC (rev 15760)
+++ CalendarServer/branches/users/cdaboo/better-next-job/txdav/dps/commands.py        2016-07-13 02:23:31 UTC (rev 15761)
</span><span class="lines">@@ -265,7 +265,16 @@
</span><span class="cx"> ]
</span><span class="cx">
</span><span class="cx">
</span><ins>+class SetAutoScheduleModeCommand(amp.Command):
+ arguments = [
+ ('uid', amp.String()),
+ ('autoScheduleMode', amp.String()),
+ ]
+ response = [
+ ('success', amp.Boolean()),
+ ]
</ins><span class="cx">
</span><ins>+
</ins><span class="cx"> class FlushCommand(amp.Command):
</span><span class="cx"> arguments = []
</span><span class="cx"> response = [
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboobetternextjobtxdavdpsserverpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/better-next-job/txdav/dps/server.py (15760 => 15761)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/better-next-job/txdav/dps/server.py        2016-07-13 02:18:08 UTC (rev 15760)
+++ CalendarServer/branches/users/cdaboo/better-next-job/txdav/dps/server.py        2016-07-13 02:23:31 UTC (rev 15761)
</span><span class="lines">@@ -45,8 +45,10 @@
</span><span class="cx"> WikiAccessForUIDCommand, ContinuationCommand,
</span><span class="cx"> ExternalDelegatesCommand, StatsCommand, ExpandedMemberUIDsCommand,
</span><span class="cx"> AddMembersCommand, RemoveMembersCommand,
</span><del>- UpdateRecordsCommand, FlushCommand, # RemoveRecordsCommand,
</del><ins>+ UpdateRecordsCommand, FlushCommand, SetAutoScheduleModeCommand,
+ # RemoveRecordsCommand,
</ins><span class="cx"> )
</span><ins>+from txdav.who.idirectory import AutoScheduleMode
</ins><span class="cx"> from txdav.who.wiki import WikiAccessLevel
</span><span class="cx">
</span><span class="cx"> from zope.interface import implementer
</span><span class="lines">@@ -540,6 +542,21 @@
</span><span class="cx"> returnValue(response)
</span><span class="cx">
</span><span class="cx">
</span><ins>+ @SetAutoScheduleModeCommand.responder
+ @inlineCallbacks
+ def setAutoScheduleMode(self, uid, autoScheduleMode):
+ uid = uid.decode("utf-8")
+ record = yield self._directory.recordWithUID(uid)
+ autoScheduleMode = autoScheduleMode.decode("utf-8")
+ autoScheduleMode = AutoScheduleMode.lookupByName(autoScheduleMode)
+ yield self._directory.setAutoScheduleMode(record, autoScheduleMode)
+ response = {
+ "success": True
+ }
+ returnValue(response)
+
+
+
</ins><span class="cx"> @GroupsCommand.responder
</span><span class="cx"> @inlineCallbacks
</span><span class="cx"> def groups(self, uid):
</span><span class="lines">@@ -851,8 +868,12 @@
</span><span class="cx"> config.Manhole.DPSPortNumber
</span><span class="cx"> )
</span><span class="cx"> manholeService = manholeMakeService({
</span><del>- "sshPort": None,
- "telnetPort": portString,
</del><ins>+ "sshPort": portString if config.Manhole.UseSSH is True else None,
+ "telnetPort": portString if config.Manhole.UseSSH is False else None,
+ "sshKeyDir": config.DataRoot,
+ "sshKeyName": "manhole.key",
+ "sshKeySize": 4096,
+ "passwd": config.Manhole.PasswordFilePath,
</ins><span class="cx"> "namespace": {
</span><span class="cx"> "config": config,
</span><span class="cx"> "service": dpsService,
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboobetternextjobtxdavdpstesttest_clientpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/better-next-job/txdav/dps/test/test_client.py (15760 => 15761)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/better-next-job/txdav/dps/test/test_client.py        2016-07-13 02:18:08 UTC (rev 15760)
+++ CalendarServer/branches/users/cdaboo/better-next-job/txdav/dps/test/test_client.py        2016-07-13 02:23:31 UTC (rev 15761)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> from txdav.who.test.support import (
</span><span class="cx"> TestRecord, CalendarInMemoryDirectoryService
</span><span class="cx"> )
</span><ins>+from txdav.who.idirectory import AutoScheduleMode
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> testMode = "xml" # "xml" or "od"
</span><span class="lines">@@ -442,6 +443,22 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> @inlineCallbacks
</span><ins>+ def test_setAutoScheduleMode(self):
+ """
+ Verify setAutoSchedule works across DPS
+ """
+ record = yield self.client.recordWithUID(u"75EA36BE-F71B-40F9-81F9-CF59BF40CA8F")
+ # Defaults to automatic
+ self.assertEquals(record.autoScheduleMode, AutoScheduleMode.acceptIfFreeDeclineIfBusy)
+ # Change it to accept-if-busy
+ yield record.setAutoScheduleMode(AutoScheduleMode.acceptIfFree)
+ # Refetch it
+ record = yield self.client.recordWithUID(u"75EA36BE-F71B-40F9-81F9-CF59BF40CA8F")
+ # Verify it's changed
+ self.assertEquals(record.autoScheduleMode, AutoScheduleMode.acceptIfFree)
+
+
+ @inlineCallbacks
</ins><span class="cx"> def test_uid(self):
</span><span class="cx"> record = (yield self.client.recordWithUID(self.wsanchezUID))
</span><span class="cx"> self.assertTrue(u"wsanchez" in record.shortNames)
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboobetternextjobtxdavwhoaugmentpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/better-next-job/txdav/who/augment.py (15760 => 15761)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/better-next-job/txdav/who/augment.py        2016-07-13 02:18:08 UTC (rev 15760)
+++ CalendarServer/branches/users/cdaboo/better-next-job/txdav/who/augment.py        2016-07-13 02:23:31 UTC (rev 15761)
</span><span class="lines">@@ -471,7 +471,27 @@
</span><span class="cx"> returnValue(augmentedRecord)
</span><span class="cx">
</span><span class="cx">
</span><ins>+ @inlineCallbacks
+ def setAutoScheduleMode(self, record, autoScheduleMode):
+ augmentRecord = yield self._augmentDB.getAugmentRecord(
+ record.uid,
+ self.recordTypeToOldName(record.recordType)
+ )
+ if augmentRecord is not None:
+ autoScheduleMode = {
+ AutoScheduleMode.none: "none",
+ AutoScheduleMode.accept: "accept-always",
+ AutoScheduleMode.decline: "decline-always",
+ AutoScheduleMode.acceptIfFree: "accept-if-free",
+ AutoScheduleMode.declineIfBusy: "decline-if-busy",
+ AutoScheduleMode.acceptIfFreeDeclineIfBusy: "automatic",
+ }.get(autoScheduleMode)
</ins><span class="cx">
</span><ins>+ augmentRecord.autoScheduleMode = autoScheduleMode
+ yield self._augmentDB.addAugmentRecords([augmentRecord])
+
+
+
</ins><span class="cx"> class AugmentedDirectoryRecord(DirectoryRecord, CalendarDirectoryRecordMixin):
</span><span class="cx"> """
</span><span class="cx"> Augmented directory record.
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboobetternextjobtxdavwhodirectorypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/better-next-job/txdav/who/directory.py (15760 => 15761)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/better-next-job/txdav/who/directory.py        2016-07-13 02:18:08 UTC (rev 15760)
+++ CalendarServer/branches/users/cdaboo/better-next-job/txdav/who/directory.py        2016-07-13 02:23:31 UTC (rev 15761)
</span><span class="lines">@@ -607,6 +607,10 @@
</span><span class="cx"> returnValue(autoScheduleMode)
</span><span class="cx">
</span><span class="cx">
</span><ins>+ def setAutoScheduleMode(self, autoScheduleMode):
+ return self.service.setAutoScheduleMode(self, autoScheduleMode)
+
+
</ins><span class="cx"> @inlineCallbacks
</span><span class="cx"> def autoAcceptFromOrganizer(self, organizer):
</span><span class="cx"> try:
</span></span></pre></div>
<a id="CalendarServerbranchesuserscdaboobetternextjobtxdavwhotesttest_directorypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/cdaboo/better-next-job/txdav/who/test/test_directory.py (15760 => 15761)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/cdaboo/better-next-job/txdav/who/test/test_directory.py        2016-07-13 02:18:08 UTC (rev 15760)
+++ CalendarServer/branches/users/cdaboo/better-next-job/txdav/who/test/test_directory.py        2016-07-13 02:23:31 UTC (rev 15761)
</span><span class="lines">@@ -358,7 +358,22 @@
</span><span class="cx"> )
</span><span class="cx">
</span><span class="cx">
</span><ins>+ @inlineCallbacks
+ def test_setAutoScheduleMode(self):
+ """
+ Verify the record.setAutoScheduleMode( ) method
+ """
+ orion = yield self.directory.recordWithUID(u"orion")
+ # Defaults to automatic
+ self.assertEquals(orion.autoScheduleMode, AutoScheduleMode.acceptIfFreeDeclineIfBusy)
+ # Change it to decline-if-busy
+ yield orion.setAutoScheduleMode(AutoScheduleMode.declineIfBusy)
+ # Refetch it
+ orion = yield self.directory.recordWithUID(u"orion")
+ # Verify it's changed
+ self.assertEquals(orion.autoScheduleMode, AutoScheduleMode.declineIfBusy)
</ins><span class="cx">
</span><ins>+
</ins><span class="cx"> class DirectoryTestCaseFakeEmail(StoreTestCase):
</span><span class="cx">
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>