#47648 lib389 - add schema classes, methods
Closed: wontfix None Opened 9 years ago by rmeggins.

This adds a Schema class with the following methods:

    def get_entry(self):
        """get the schema as an LDAP entry"""
    def get_subschema(self):
        """get the schema as a python-ldap SubSchema object"""
    def list_files(self):
        """return a list of the schema files in the instance schemadir"""
    def file_to_ldap(self, filename):
        """convert the given schema file name to its python-ldap format
        suitable for passing to ldap.schema.SubSchema()
        @param filename - the full path and filename of a schema file in ldif format"""
    def file_to_subschema(self, filename):
        """convert the given schema file name to its python-ldap format
        ldap.schema.SubSchema object
        @param filename - the full path and filename of a schema file in ldif format"""
    def add_schema(self, attr, val):
        """Add a schema element to the schema.
        @param attr the attribute type to use e.g. attributeTypes or objectClasses
        @param val the schema element definition to add"""
    def del_schema(self, attr, val):
        """Delete a schema element from the schema.
        @param attr the attribute type to use e.g. attributeTypes or objectClasses
        @param val the schema element definition to delete"""
    def add_attribute(self, *attributes):
        """Add an attribute type definition to the schema.
        @param attributes a single or list of attribute type defintions to add"""
    def add_objectclass(self, *objectclasses):
        """Add an object class definition to the schema.
        @param objectclasses a single or list of object class defintions to add"""
    def get_schema_csn(self):
        """return the schema nsSchemaCSN attribute"""

The changes are good. I just wonder if it worth to make add_schema and del_schema local methods and only export add/del_attribute/objectclass

ack

Opps click too fast.
Also you may remove the existing methods in init.py:addSchema/delSchema/addAttr/addObjClass and getSchemaCSN

Thanks Thierry. Attached is a new patch which should address your concerns.

To ssh://git.fedorahosted.org/git/389/lib389.git
1337b98..44d510e master -> master
commit 44d510e9e8852e75aa8fc1ba122cdbd51be16c21
Author: Rich Megginson rmeggins@redhat.com
Date: Thu Dec 19 14:21:52 2013 -0700

Milestone lib389 1.0 deleted

Metadata Update from @rmeggins:
- Issue assigned to rmeggins

6 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/389ds/389-ds-base/issues/985

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata Update from @spichugi:
- Issue close_status updated to: wontfix (was: Fixed)

2 years ago

Login to comment on this ticket.

Metadata