summaryrefslogtreecommitdiffstats
path: root/install/tools
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2013-01-21 07:03:33 -0500
committerMartin Kosek <mkosek@redhat.com>2013-03-01 16:59:44 +0100
commitb69f6983e4bb01e2af63c4b02a0ab79b24e59569 (patch)
treea3c3c69a55b2b82bb1a536a7b527cbe0169f0561 /install/tools
parent607ff478f55e330ab68744beb699dc96d6a5f94a (diff)
downloadfreeipa-b69f6983e4bb01e2af63c4b02a0ab79b24e59569.tar.gz
freeipa-b69f6983e4bb01e2af63c4b02a0ab79b24e59569.tar.xz
freeipa-b69f6983e4bb01e2af63c4b02a0ab79b24e59569.zip
Remove IPAdmin.get_dns_sorted_by_length
A simple sort(key=len) is simpler both implementation-wise and semantics-wise. Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
Diffstat (limited to 'install/tools')
-rwxr-xr-xinstall/tools/ipa-replica-manage10
1 files changed, 4 insertions, 6 deletions
diff --git a/install/tools/ipa-replica-manage b/install/tools/ipa-replica-manage
index 698a02f54..85535c0e6 100755
--- a/install/tools/ipa-replica-manage
+++ b/install/tools/ipa-replica-manage
@@ -299,12 +299,10 @@ def del_link(realm, replica1, replica2, dirman_passwd, force=False):
dn = DN(('cn', replica2), ('cn', 'replicas'), ('cn', 'ipa'), ('cn', 'etc'),
ipautil.realm_to_suffix(realm))
entries = repl1.conn.getList(dn, ldap.SCOPE_SUBTREE)
- if len(entries) != 0:
- dnset = repl1.conn.get_dns_sorted_by_length(entries,
- reverse=True)
- for dns in dnset:
- for dn in dns:
- repl1.conn.deleteEntry(dn)
+ if entries:
+ entries.sort(key=len, reverse=True)
+ for dn in entries:
+ repl1.conn.deleteEntry(dn)
except Exception, e:
print "Error deleting winsync replica shared info: %s" % convert_error(e)