[Zope-CVS] CVS: RepoUtils - postcommit.py:2.5

Ken Manheimer klm at zope.com
Wed Jan 28 16:51:22 EST 2004


Update of /cvs-repository/RepoUtils
In directory cvs.zope.org:/tmp/cvs-serv5738

Modified Files:
	postcommit.py 
Log Message:
Providing a helper to do ldap settings, for manual testing outside of
postcommit_actions. 


=== RepoUtils/postcommit.py 2.4 => 2.5 ===
--- RepoUtils/postcommit.py:2.4	Sat Dec 13 14:07:58 2003
+++ RepoUtils/postcommit.py	Wed Jan 28 16:51:21 2004
@@ -120,9 +120,9 @@
 
     global VERBOSE, SCRIPT
     global LDAP_HOST, LDAP_PORT, LDAP_SEARCH_BASE, LDAP_FILTER_LIST_TEMPLATE
-    LDAP_HOST, LDAP_PORT = ldap_host, ldap_port
-    LDAP_SEARCH_BASE = ldap_search_base
-    LDAP_FILTER_LIST_TEMPLATE = ldap_filter_list_template
+    set_ldap(ldap_host=ldap_host, ldap_port=ldap_port,
+             ldap_search_base=ldap_search_base,
+             ldap_filter_list_template=ldap_filter_list_template)
 
     orig_args = args[:]
 
@@ -224,6 +224,19 @@
 
     if msgfilenm:
         os.unlink(msgfilenm)
+
+def set_ldap(ldap_host=None, ldap_port=389,
+             ldap_search_base=None,
+             ldap_filter_list_template=None):
+    """Establish global settings.
+
+    cvs_postcommit calls this, so you only need to do it if you want
+    to use other functions without going through cvs_postcommit."""
+
+    global LDAP_HOST, LDAP_PORT, LDAP_SEARCH_BASE, LDAP_FILTER_LIST_TEMPLATE
+    LDAP_HOST, LDAP_PORT = ldap_host, ldap_port
+    LDAP_SEARCH_BASE = ldap_search_base
+    LDAP_FILTER_LIST_TEMPLATE = ldap_filter_list_template
 
 def detach(args):
     """Fork us into the background, with stdout and stderr to OUTPUT_LOG.




More information about the Zope-CVS mailing list