summaryrefslogtreecommitdiffstats
path: root/ipapython
diff options
context:
space:
mode:
Diffstat (limited to 'ipapython')
-rw-r--r--ipapython/ipautil.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/ipapython/ipautil.py b/ipapython/ipautil.py
index c810adcd3..60b4a37fe 100644
--- a/ipapython/ipautil.py
+++ b/ipapython/ipautil.py
@@ -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']