Hello,

I've got a problem with ldap.subschema and multiple SUP entries. I'm using 
python-ldap 2.2.0.

My test program:
******************************************
[EMAIL PROTECTED]:~# cat schema-test.py
#!/usr/bin/python2.4

import ldap.schema

attr={  'cn': ['Subschema'],
        'objectClasses': ["( 0.9.2342.19200300.100.4.20 
NAME 'pilotOrganization' SUP ( organization $ organizationalUnit ) STRUCTURAL 
MAY buildingName )"],
}

subschema = ldap.schema.SubSchema(attr)

for oid in subschema.listall(ldap.schema.ObjectClass):
        print 'OID: %s' % oid
        obj = subschema.get_obj(ldap.schema.ObjectClass, oid)
        print 'OBJ: %s' % obj
******************************************

If I call the program I got the following output:
[EMAIL PROTECTED]:~# ./schema-test.py
OID: 0.9.2342.19200300.100.4.20
OBJ: ( 0.9.2342.19200300.100.4.20 NAME 'pilotOrganization' SUP ( organization 
organizationalUnit ) STRUCTURAL MAY buildingName )

I think there should be a "$" beetween "organization" 
and "organizationalUnit".

The attached patch seems to work.

Cheers
Stefan

-- 
Stefan Gohmann         Entwicklung              [EMAIL PROTECTED]
Univention GmbH        Linux for your Business  fon: +49 421 22 232- 0
Mary-Somerville-Str.1  28359 Bremen             fax: +49 421 22 232-99
                       http://www.univention.de
diff -Nur python-ldap-2.2.0.orig/Lib/ldap/schema/models.py python-ldap-2.2.0/Lib/ldap/schema/models.py
--- python-ldap-2.2.0.orig/Lib/ldap/schema/models.py	2006-03-26 14:25:24.000000000 +0200
+++ python-ldap-2.2.0/Lib/ldap/schema/models.py	2007-07-24 15:17:23.000000000 +0200
@@ -144,7 +144,7 @@
     result = [str(self.oid)]
     result.append(self.key_list('NAME',self.names,quoted=1))
     result.append(self.key_attr('DESC',self.desc,quoted=1))
-    result.append(self.key_list('SUP',self.sup))
+    result.append(self.key_list('SUP',self.sup,sep=' $ '))
     result.append({0:'',1:' OBSOLETE'}[self.obsolete])
     result.append({0:' STRUCTURAL',1:' ABSTRACT',2:' AUXILIARY'}[self.kind])
     result.append(self.key_list('MUST',self.must,sep=' $ '))
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Python-LDAP-dev mailing list
Python-LDAP-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/python-ldap-dev

Reply via email to