Re: Best way to add an implementation specific schema model?

2009-11-12 Thread Michael Ströder
Chris Dukes wrote:
> I have to work with IBM Directory Server on a regular basis, and that
> includes some nasty schema analysis for moving some history local schema
> modifications to new versions of the product.
> I was able to use ldap.schema to simplify most of the nastiness.
> 
> However, IBM extends the schema with the additional attribute
> IBMAttributetypes, which describes chracteristics of how attributes will
> be stored in the backend.
> 
> IBM was polite enough to document the grammar for this new attribute and
> I'll be attempting to create an IBMAttributetype class to hold these.

I vaguely remember coming across these proprietary IBM schema attributes. I
wonder why they did not add their specific things to normal
AttributeTypeDescription like other directory vendors did. Oh, well...

Could you please refer to docs of the grammar?

> Now, should I just add the new class to ldap.schema.models and submit a
> patch once done?  Or should a long term approach of being able to
> indicate the addition of server specific extensions be contemplated?

I already thought about this when looking at vendor-specific extensions for
AttributeTypeDescription for Novell eDirectory and OpenLDAP.

Here are some remarks:

1. ldap.schema is somewhat experimental although quite robust in recent
deployments. The API is still undocumented mainly because I would be willing
to change it if someone comes up with good ideas how to improve it.

2. Lib/ldap/schema/models.py is very closely modeled after RFC 4512. If the
IBM grammar loosely follows what's in that RFC 4512 you have a good chance to
derive from these classes and extend them by setting class attribute
token_defaults according to what's needed.

3. There's ldap.schema.subentry.SCHEMA_CLASS_MAPPING which maps subschema
subentry attribute types to Python schema classes in ldap.schema.models. So
you have to somewhat register the IBM-specific attributes there.

Curious to hear about how to proceed with that.

Ciao, Michael.


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Python-LDAP-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/python-ldap-dev


Re: Compile error on RHEL 5.3 (x86_64), python-ldap-2.3.10

2009-11-12 Thread Michael Ströder
Rob Orsini wrote:
> Hi, I'm also having trouble getting 2.3.10 to compile on RHEL 5. I tried
> applying the patches supplied in this thread (I just joined this email
> list, btw):
> 
> In file included from Modules/LDAPObject.c:4:
> Modules/common.h:10:20: error: Python.h: No such file or directory

Please make sure you have all the necessary headers available on your system
for building Python extension modules and all the libs needed by python-ldap.
I don't know the package names on RHEL though.

Ciao, Michael.



--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Python-LDAP-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/python-ldap-dev


Re: Compile error on RHEL 5.3 (x86_64), python-ldap-2.3.10

2009-11-12 Thread Zhang Huangbin

On Nov 5, 2009, at 1:14 AM, Michael Ströder wrote:

> This is because of older OpenLDAP libs. Try the patch below. It's also in HEAD
> now.

I'm so sorry that i forgot this thread :(

I tested patch moment ago, failed to build, same as in HEAD (checked out moment 
ago):


# python setup.py clean
extra_compile_args: 
extra_objects: 
include_dirs: /usr/local/openldap-2.3/include /usr/include/sasl
library_dirs: /usr/local/openldap-2.3/lib
libs: ldap_r lber sasl2 ssl crypto
running clean
[r...@r6 python-ldap]# python setup.py install
extra_compile_args: 
extra_objects: 
include_dirs: /usr/local/openldap-2.3/include /usr/include/sasl
library_dirs: /usr/local/openldap-2.3/lib
libs: ldap_r lber sasl2 ssl crypto
running install
running bdist_egg
running egg_info
creating Lib/python_ldap.egg-info
writing requirements to Lib/python_ldap.egg-info/requires.txt
writing Lib/python_ldap.egg-info/PKG-INFO
writing top-level names to Lib/python_ldap.egg-info/top_level.txt
writing dependency_links to Lib/python_ldap.egg-info/dependency_links.txt
writing manifest file 'Lib/python_ldap.egg-info/SOURCES.txt'
file Lib/ldap.py (for module ldap) not found
file Lib/ldap/schema.py (for module ldap.schema) not found
reading manifest template 'MANIFEST.in'
warning: no files found matching 'Makefile'
warning: no files found matching 'Modules/LICENSE'
writing manifest file 'Lib/python_ldap.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
file Lib/ldap.py (for module ldap) not found
file Lib/ldap/schema.py (for module ldap.schema) not found
creating build
creating build/lib.linux-x86_64-2.4
copying Lib/ldapurl.py -> build/lib.linux-x86_64-2.4
copying Lib/ldif.py -> build/lib.linux-x86_64-2.4
copying Lib/dsml.py -> build/lib.linux-x86_64-2.4
creating build/lib.linux-x86_64-2.4/ldap
copying Lib/ldap/__init__.py -> build/lib.linux-x86_64-2.4/ldap
copying Lib/ldap/async.py -> build/lib.linux-x86_64-2.4/ldap
copying Lib/ldap/controls.py -> build/lib.linux-x86_64-2.4/ldap
copying Lib/ldap/cidict.py -> build/lib.linux-x86_64-2.4/ldap
copying Lib/ldap/dn.py -> build/lib.linux-x86_64-2.4/ldap
copying Lib/ldap/filter.py -> build/lib.linux-x86_64-2.4/ldap
copying Lib/ldap/functions.py -> build/lib.linux-x86_64-2.4/ldap
copying Lib/ldap/ldapobject.py -> build/lib.linux-x86_64-2.4/ldap
copying Lib/ldap/modlist.py -> build/lib.linux-x86_64-2.4/ldap
copying Lib/ldap/resiter.py -> build/lib.linux-x86_64-2.4/ldap
copying Lib/ldap/sasl.py -> build/lib.linux-x86_64-2.4/ldap
creating build/lib.linux-x86_64-2.4/ldap/schema
copying Lib/ldap/schema/__init__.py -> build/lib.linux-x86_64-2.4/ldap/schema
copying Lib/ldap/schema/models.py -> build/lib.linux-x86_64-2.4/ldap/schema
copying Lib/ldap/schema/subentry.py -> build/lib.linux-x86_64-2.4/ldap/schema
copying Lib/ldap/schema/tokenizer.py -> build/lib.linux-x86_64-2.4/ldap/schema
file Lib/ldap.py (for module ldap) not found
file Lib/ldap/schema.py (for module ldap.schema) not found
running build_ext
building '_ldap' extension
creating build/temp.linux-x86_64-2.4
creating build/temp.linux-x86_64-2.4/Modules
gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall 
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector 
--param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fPIC 
-DHAVE_LIBLDAP_R -DHAVE_SASL -DHAVE_TLS -DLDAPMODULE_VERSION=2.3.10 -IModules 
-I/usr/local/openldap-2.3/include -I/usr/include/sasl -I/usr/include/python2.4 
-c Modules/LDAPObject.c -o build/temp.linux-x86_64-2.4/Modules/LDAPObject.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall 
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector 
--param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fPIC 
-DHAVE_LIBLDAP_R -DHAVE_SASL -DHAVE_TLS -DLDAPMODULE_VERSION=2.3.10 -IModules 
-I/usr/local/openldap-2.3/include -I/usr/include/sasl -I/usr/include/python2.4 
-c Modules/ldapcontrol.c -o build/temp.linux-x86_64-2.4/Modules/ldapcontrol.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall 
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector 
--param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fPIC 
-DHAVE_LIBLDAP_R -DHAVE_SASL -DHAVE_TLS -DLDAPMODULE_VERSION=2.3.10 -IModules 
-I/usr/local/openldap-2.3/include -I/usr/include/sasl -I/usr/include/python2.4 
-c Modules/common.c -o build/temp.linux-x86_64-2.4/Modules/common.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall 
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector 
--param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fPIC 
-DHAVE_LIBLDAP_R -DHAVE_SASL -DHAVE_TLS -DLDAPMODULE_VERSION=2.3.10 -IModules 
-I/usr/local/openldap-2.3/include -I/usr/include/sasl -I/usr/include/python2.4 
-c Modules/constants.c -o build/temp.linux-x86_64-2.4/Modules/constants.o
Modules/constants.c: In function ‘LDAPinit_constants’:
Modules/constants.c:186: error: ‘LDAP_OPT_X_TLS_NEWCTX’ undeclared (first use 
in this function)
Modules/constants.