From 208e6930de94f56264f5964411bbe1b0d6684516 Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Fri, 31 Aug 2012 05:29:32 -0400 Subject: Sort policies numerically in pwpolicy-find Password policies in pwpolicy-find are now sorted in the expected numerical manner. Also tweaks one of the unit tests so that it tests this behaviour. https://fedorahosted.org/freeipa/ticket/3039 --- ipalib/plugins/pwpolicy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ipalib/plugins/pwpolicy.py') diff --git a/ipalib/plugins/pwpolicy.py b/ipalib/plugins/pwpolicy.py index 33c8329f7..5ae07c40d 100644 --- a/ipalib/plugins/pwpolicy.py +++ b/ipalib/plugins/pwpolicy.py @@ -481,7 +481,7 @@ class pwpolicy_find(LDAPSearch): # policies with higher priority (lower number) will be at the # beginning of the list try: - cospriority = entry[1]['cospriority'][0] + cospriority = int(entry[1]['cospriority'][0]) except KeyError: # if cospriority is not present in the entry, rather return 0 # than crash -- cgit