[CalendarServer-changes] [14889] CalDAVTester/trunk/odsetup.py

source_changes at macosforge.org source_changes at macosforge.org
Mon Jun 8 09:08:04 PDT 2015


Revision: 14889
          http://trac.calendarserver.org//changeset/14889
Author:   cdaboo at apple.com
Date:     2015-06-08 09:08:04 -0700 (Mon, 08 Jun 2015)
Log Message:
-----------
Add check for unwanted LDAPv3 nodes bound to the local host.

Modified Paths:
--------------
    CalDAVTester/trunk/odsetup.py

Modified: CalDAVTester/trunk/odsetup.py
===================================================================
--- CalDAVTester/trunk/odsetup.py	2015-06-08 15:00:13 UTC (rev 14888)
+++ CalDAVTester/trunk/odsetup.py	2015-06-08 16:08:04 UTC (rev 14889)
@@ -282,6 +282,24 @@
 
 
 
+def checkDataSource(node):
+    """
+    Verify that the specified node is the only node this host is bound to.
+
+    @param node: the node to verify
+    @type node: L{str}
+    """
+
+    result = cmd("dscl localhost -list /LDAPv3")
+    result = ["/LDAPv3/{}".format(subnode) for subnode in result[0].splitlines()]
+    if len(result) > 1 or result[0] != node:
+        print "Error: Host is bound to other directory nodes: {}".format(result)
+        print "CalDAVTester will likely fail with other nodes present."
+        print "Please remove all nodes except the one being used for odsetup."
+        sys.exit(1)
+
+
+
 def readConfig():
     """
     Read useful information from calendarserver_config
@@ -710,6 +728,8 @@
             usage()
             raise ValueError
 
+        checkDataSource(directory_node)
+
         if args[0] == "create":
             # Read the caldavd.plist file and extract some information we will need.
             hostname, port, sslport, authtype, docroot = readConfig()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20150608/48d3ba1a/attachment.html>


More information about the calendarserver-changes mailing list