pgreco / rpms / ipa

Forked from forks/areguera/rpms/ipa 4 years ago
Clone

Blame SOURCES/0154-wait_for_entry-use-only-DN-as-parameter.patch

ff14fa
From a9a9d67637c394ca1490e8e7df790c06b3480c56 Mon Sep 17 00:00:00 2001
ff14fa
From: Martin Basti <mbasti@redhat.com>
ff14fa
Date: Wed, 18 Jan 2017 12:55:13 +0100
ff14fa
Subject: [PATCH] wait_for_entry: use only DN as parameter
ff14fa
ff14fa
Using the whole entry is not needed as parameter because only DN is used
ff14fa
and it prevents easier usage of this function
ff14fa
ff14fa
https://fedorahosted.org/freeipa/ticket/6588
ff14fa
ff14fa
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
ff14fa
---
ff14fa
 ipaserver/install/dogtaginstance.py | 2 +-
ff14fa
 ipaserver/install/replication.py    | 6 ++----
ff14fa
 2 files changed, 3 insertions(+), 5 deletions(-)
ff14fa
ff14fa
diff --git a/ipaserver/install/dogtaginstance.py b/ipaserver/install/dogtaginstance.py
ff14fa
index b65628277d9e361a3ab5674dfd2689e258b1887b..2a2ab6fc7f90514013b5a6f368739c2f1706ed9b 100644
ff14fa
--- a/ipaserver/install/dogtaginstance.py
ff14fa
+++ b/ipaserver/install/dogtaginstance.py
ff14fa
@@ -470,7 +470,7 @@ class DogtagInstance(service.Service):
ff14fa
                                       port=389,
ff14fa
                                       protocol='ldap')
ff14fa
         master_conn.do_sasl_gssapi_bind()
ff14fa
-        replication.wait_for_entry(master_conn, entry)
ff14fa
+        replication.wait_for_entry(master_conn, entry.dn)
ff14fa
         del master_conn
ff14fa
 
ff14fa
     def __remove_admin_from_group(self, group):
ff14fa
diff --git a/ipaserver/install/replication.py b/ipaserver/install/replication.py
ff14fa
index 5f03ddeadfc515255509a1f49d3b38687e561b9f..be4de6dd0037a028bcaf1743be74a80855ba3541 100644
ff14fa
--- a/ipaserver/install/replication.py
ff14fa
+++ b/ipaserver/install/replication.py
ff14fa
@@ -150,7 +150,7 @@ def wait_for_task(conn, dn):
ff14fa
     return exit_code
ff14fa
 
ff14fa
 
ff14fa
-def wait_for_entry(connection, entry, timeout=7200, attr='', quiet=True):
ff14fa
+def wait_for_entry(connection, dn, timeout=7200, attr='', quiet=True):
ff14fa
     """Wait for entry and/or attr to show up"""
ff14fa
 
ff14fa
     filter = "(objectclass=*)"
ff14fa
@@ -160,8 +160,6 @@ def wait_for_entry(connection, entry, timeout=7200, attr='', quiet=True):
ff14fa
         attrlist.append(attr)
ff14fa
     timeout += int(time.time())
ff14fa
 
ff14fa
-    dn = entry.dn
ff14fa
-
ff14fa
     if not quiet:
ff14fa
         sys.stdout.write("Waiting for %s %s:%s " % (connection, dn, attr))
ff14fa
         sys.stdout.flush()
ff14fa
@@ -732,7 +730,7 @@ class ReplicationManager(object):
ff14fa
             # that we will have to set the memberof fixup task
ff14fa
             self.need_memberof_fixup = True
ff14fa
 
ff14fa
-        wait_for_entry(a_conn, entry)
ff14fa
+        wait_for_entry(a_conn, entry.dn)
ff14fa
 
ff14fa
     def needs_memberof_fixup(self):
ff14fa
         return self.need_memberof_fixup
ff14fa
-- 
ff14fa
2.9.3
ff14fa