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
This commit is contained in:
Tomas Babej
2012-08-31 05:29:32 -04:00
committed by Rob Crittenden
parent be8a9e6ddb
commit 208e6930de
2 changed files with 5 additions and 3 deletions

View File

@@ -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