From c781e8a57d3d05fa07729dbccff07bc1fab9d8e8 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Mon, 10 Aug 2009 16:24:10 -0400 Subject: Add a new objectclass, ipaObject, that will add a UUID to many IPA objects ipaObject is defined as an auxiliary objectclass so it is up to the plugin author to ensure that the objectclass is included an a UUID generated. ipaUniqueId is a MUST attribute so if you include the objectclass you must ensure that the uuid is generated. This also fixes up some unrelated unit test failures. --- ipalib/plugins/basegroup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ipalib/plugins/basegroup.py') diff --git a/ipalib/plugins/basegroup.py b/ipalib/plugins/basegroup.py index edcc9999..9cfd3506 100644 --- a/ipalib/plugins/basegroup.py +++ b/ipalib/plugins/basegroup.py @@ -25,6 +25,7 @@ Base plugin for groups. from ipalib import api, crud, errors from ipalib import Command, Object from ipalib import Flag, Int, List, Str +from ipalib import uuid _default_attributes = ['cn', 'description', 'member', 'memberof'] _default_class = 'groupofnames' @@ -137,7 +138,7 @@ class basegroup_add(crud.Create): """ Create new group. """ - base_classes = ('top', _default_class) + base_classes = ('top', 'ipaobject', _default_class) def execute(self, cn, **kw): """ @@ -162,6 +163,8 @@ class basegroup_add(crud.Create): else: entry_attrs['objectclass'] = self.base_classes + entry_attrs['ipauniqueid'] = str(uuid.uuid1()) + ldap.add_entry(dn, entry_attrs) return ldap.get_entry(dn, entry_attrs.keys()) -- cgit