From 1dd9e1407361bdd6ed337c70dcb1d209ce034cb6 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Fri, 1 Jul 2011 15:32:31 -0400 Subject: Optionally wait for 389-ds postop plugins to complete Add a new command that lets you wait for an attribute to appear in a value. Using this you can do things like wait for a managed entry to be created, adding a new objectclass to the parent entry. This is controlled by a new booleon option, wait_for_attr, defaulting to False. https://fedorahosted.org/freeipa/ticket/1144 --- ipalib/plugins/hostgroup.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ipalib/plugins/hostgroup.py') diff --git a/ipalib/plugins/hostgroup.py b/ipalib/plugins/hostgroup.py index 11ed6637..ef44a8b9 100644 --- a/ipalib/plugins/hostgroup.py +++ b/ipalib/plugins/hostgroup.py @@ -98,6 +98,14 @@ class hostgroup_add(LDAPCreate): msg_summary = _('Added hostgroup "%(value)s"') + def post_callback(self, ldap, dn, entry_attrs, *keys, **options): + if self.api.env.wait_for_attr: + newentry = wait_for_value(ldap, dn, 'objectclass', 'mepOriginEntry') + entry_from_entry(entry_attrs, newentry) + + return dn + + api.register(hostgroup_add) -- cgit