r26623: python: Allow specifying URL rather than host name on the command-line.
authorJelmer Vernooij <jelmer@samba.org>
Fri, 28 Dec 2007 22:25:20 +0000 (16:25 -0600)
committerStefan Metzmacher <metze@samba.org>
Fri, 28 Dec 2007 16:33:02 +0000 (10:33 -0600)
(This used to be commit 108f6caffe2bb311495b89659cfd818f0ec410f2)

source4/lib/ldb/tests/python/ldap.py

index 2b5f43920c5107eb2f2ac5e95833f10d37e34672..3f70ef9b43ca9b511bf73a1c020c3d0f47142837 100755 (executable)
@@ -955,8 +955,10 @@ def find_schemadn(ldb):
     assertEquals(len(res), 1)
     return res[0].schemaNamingContext
 
+if not "://" in host:
+    host = "ldap://%s" % host
 
-ldb = Ldb("ldap://%s" % host, credentials=creds, session_info=system_session(), 
+ldb = Ldb(host, credentials=creds, session_info=system_session(), 
           lp=lp)
 base_dn = find_basedn(ldb)
 
@@ -965,7 +967,7 @@ schema_dn = find_schemadn(ldb)
 
 print "baseDN: %s\n" % base_dn
 
-gc_ldb = Ldb("ldap://%s:3268" % host, credentials=creds, 
+gc_ldb = Ldb("%s:3268" % host, credentials=creds, 
              session_info=system_session(), lp=lp)
 
 basic_tests(ldb, gc_ldb, base_dn, configuration_dn, schema_dn)