mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-11 08:41:55 -06:00
py3: ipa_generate_password: do not compare None and Int
The one cannot compare None and Int in Py3 """ unorderable types: NoneType() > int() """ Continue when class is disabled with None value https://fedorahosted.org/freeipa/ticket/4985 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
parent
69072cb80f
commit
dd119f8aad
@ -860,6 +860,8 @@ def ipa_generate_password(entropy_bits=256, uppercase=1, lowercase=1, digits=1,
|
||||
for charclass_name in ['digits', 'uppercase', 'lowercase', 'special']:
|
||||
charclass = pwd_charsets[charclass_name]
|
||||
todo_characters = req_classes[charclass_name]
|
||||
if todo_characters is None:
|
||||
continue
|
||||
while todo_characters > 0:
|
||||
password += rnd.choice(charclass['chars'])
|
||||
todo_entropy -= charclass['entropy']
|
||||
|
Loading…
Reference in New Issue
Block a user