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/service.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ipalib/plugins/service.py') diff --git a/ipalib/plugins/service.py b/ipalib/plugins/service.py index 03204acb..8d852ca4 100644 --- a/ipalib/plugins/service.py +++ b/ipalib/plugins/service.py @@ -28,6 +28,7 @@ from OpenSSL import crypto from ipalib import api, crud, errors from ipalib import Object from ipalib import Str, Flag, Bytes +from ipalib import uuid _container_dn = api.env.container_service _default_attributes = ['krbprincipalname', 'usercertificate'] @@ -152,8 +153,9 @@ class service_add(crud.Create): entry_attrs = self.args_options_2_entry(principal, **kw) entry_attrs['objectclass'] = [ 'krbprincipal', 'krbprincipalaux', 'krbticketpolicyaux', - 'ipaservice', 'pkiuser' + 'ipaobject', 'ipaservice', 'pkiuser' ] + entry_attrs['ipauniqueid'] = str(uuid.uuid1()) dn = ldap.make_dn(entry_attrs, 'krbprincipalname', _container_dn) ldap.add_entry(dn, entry_attrs) -- cgit