summaryrefslogtreecommitdiffstats
path: root/install/tools/ipa-csreplica-manage
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2013-01-28 12:02:48 -0500
committerMartin Kosek <mkosek@redhat.com>2013-03-01 16:59:46 +0100
commit8f44811a9570e2a0dbc821b6ca48748a5d6eace7 (patch)
treeeac02c7f1ab13894ff2e47b4757534923e3fb6a6 /install/tools/ipa-csreplica-manage
parentd7bf70902b4285c40e33e426b9e16fbbbdbf8f8c (diff)
downloadfreeipa-8f44811a9570e2a0dbc821b6ca48748a5d6eace7.tar.gz
freeipa-8f44811a9570e2a0dbc821b6ca48748a5d6eace7.tar.xz
freeipa-8f44811a9570e2a0dbc821b6ca48748a5d6eace7.zip
Remove search_s and search_ext_s from IPAdmin
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
Diffstat (limited to 'install/tools/ipa-csreplica-manage')
-rwxr-xr-xinstall/tools/ipa-csreplica-manage16
1 files changed, 9 insertions, 7 deletions
diff --git a/install/tools/ipa-csreplica-manage b/install/tools/ipa-csreplica-manage
index 3f10c9003..bb557f485 100755
--- a/install/tools/ipa-csreplica-manage
+++ b/install/tools/ipa-csreplica-manage
@@ -394,14 +394,14 @@ def add_link(realm, replica1, replica2, dirman_passwd, options):
dn = DN(('cn', 'CA'), ('cn', replica2), ('cn', 'masters'), ('cn', 'ipa'), ('cn', 'etc'),
ipautil.realm_to_suffix(realm))
- conn.search_s(dn, ldap.SCOPE_ONELEVEL)
+ conn.get_entries(dn, ldap.SCOPE_ONELEVEL)
conn.unbind_s()
- except ldap.NO_SUCH_OBJECT:
+ except errors.NotFound:
sys.exit('%s does not have a CA configured.' % replica2)
- except ldap.SERVER_DOWN, e:
- sys.exit("Unable to connect to %s: %s" % (ipautil.format_netloc(replica2, 636), convert_error(e)))
+ except errors.NetworkError, e:
+ sys.exit("Unable to connect to %s: %s" % (ipautil.format_netloc(replica2, 636), str(e)))
except Exception, e:
- sys.exit("Failed to get data while trying to bind to '%s': %s" % (replica1, convert_error(e)))
+ sys.exit("Failed to get data while trying to bind to '%s': %s" % (replica1, str(e)))
try:
repl1 = get_cs_replication_manager(realm, replica1, dirman_passwd)
@@ -434,8 +434,10 @@ def re_initialize(realm, options):
thishost = installutils.get_fqdn()
filter = repl.get_agreement_filter(host=thishost)
- entry = repl.conn.search_s(DN(('cn', 'config')), ldap.SCOPE_SUBTREE, filter)
- if len(entry) == 0:
+ try:
+ entry = repl.conn.get_entries(
+ DN(('cn', 'config')), ldap.SCOPE_SUBTREE, filter)
+ except errors.NotFound:
root_logger.error("Unable to find %s -> %s replication agreement" % (options.fromhost, thishost))
sys.exit(1)
if len(entry) > 1: