From 3d0a0728766aed7245427b9eaf210e31fd40e440 Mon Sep 17 00:00:00 2001 From: Martin Basti Date: Jan 25 2017 12:42:56 +0000 Subject: wait_for_entry: use only DN as parameter Using the whole entry is not needed as parameter because only DN is used and it prevents easier usage of this function https://fedorahosted.org/freeipa/ticket/6588 Reviewed-By: Stanislav Laznicka --- diff --git a/ipaserver/install/dogtaginstance.py b/ipaserver/install/dogtaginstance.py index b656282..2a2ab6f 100644 --- a/ipaserver/install/dogtaginstance.py +++ b/ipaserver/install/dogtaginstance.py @@ -470,7 +470,7 @@ class DogtagInstance(service.Service): port=389, protocol='ldap') master_conn.do_sasl_gssapi_bind() - replication.wait_for_entry(master_conn, entry) + replication.wait_for_entry(master_conn, entry.dn) del master_conn def __remove_admin_from_group(self, group): diff --git a/ipaserver/install/replication.py b/ipaserver/install/replication.py index fe62626..d0e4a20 100644 --- a/ipaserver/install/replication.py +++ b/ipaserver/install/replication.py @@ -152,7 +152,7 @@ def wait_for_task(conn, dn): return exit_code -def wait_for_entry(connection, entry, timeout=7200, attr='', quiet=True): +def wait_for_entry(connection, dn, timeout=7200, attr='', quiet=True): """Wait for entry and/or attr to show up""" filter = "(objectclass=*)" @@ -162,8 +162,6 @@ def wait_for_entry(connection, entry, timeout=7200, attr='', quiet=True): attrlist.append(attr) timeout += int(time.time()) - dn = entry.dn - if not quiet: sys.stdout.write("Waiting for %s %s:%s " % (connection, dn, attr)) sys.stdout.flush() @@ -734,7 +732,7 @@ class ReplicationManager(object): # that we will have to set the memberof fixup task self.need_memberof_fixup = True - wait_for_entry(a_conn, entry) + wait_for_entry(a_conn, entry.dn) def needs_memberof_fixup(self): return self.need_memberof_fixup