summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/hostgroup.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2011-07-01 15:32:31 -0400
committerMartin Kosek <mkosek@redhat.com>2011-07-19 13:06:16 +0200
commit1dd9e1407361bdd6ed337c70dcb1d209ce034cb6 (patch)
tree1b81a20a3835de965f40f35195ea22fbbe731afc /ipalib/plugins/hostgroup.py
parentc09f116f4331175b3fb01f0bd62e78ef47fab716 (diff)
downloadfreeipa-1dd9e1407361bdd6ed337c70dcb1d209ce034cb6.tar.gz
freeipa-1dd9e1407361bdd6ed337c70dcb1d209ce034cb6.tar.xz
freeipa-1dd9e1407361bdd6ed337c70dcb1d209ce034cb6.zip
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
Diffstat (limited to 'ipalib/plugins/hostgroup.py')
-rw-r--r--ipalib/plugins/hostgroup.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/ipalib/plugins/hostgroup.py b/ipalib/plugins/hostgroup.py
index 11ed66376..ef44a8b9b 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)