mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
interactive installer does not ignore leading/trailing whitespace
https://fedorahosted.org/freeipa/ticket/5355 Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
parent
4ec8df2739
commit
9ffb388253
@ -763,7 +763,7 @@ def user_input(prompt, default = None, allow_empty = True):
|
||||
try:
|
||||
ret = input("%s: " % prompt)
|
||||
if allow_empty or ret.strip():
|
||||
return ret
|
||||
return ret.strip()
|
||||
except EOFError:
|
||||
if allow_empty:
|
||||
return ''
|
||||
@ -776,7 +776,7 @@ def user_input(prompt, default = None, allow_empty = True):
|
||||
if not ret and (allow_empty or default):
|
||||
return default
|
||||
elif ret.strip():
|
||||
return ret
|
||||
return ret.strip()
|
||||
except EOFError:
|
||||
return default
|
||||
|
||||
@ -785,6 +785,7 @@ def user_input(prompt, default = None, allow_empty = True):
|
||||
while True:
|
||||
try:
|
||||
ret = input("%s [%s]: " % (prompt, choice))
|
||||
ret = ret.strip()
|
||||
if not ret:
|
||||
return default
|
||||
elif ret.lower()[0] == "y":
|
||||
@ -798,6 +799,7 @@ def user_input(prompt, default = None, allow_empty = True):
|
||||
while True:
|
||||
try:
|
||||
ret = input("%s [%s]: " % (prompt, default))
|
||||
ret = ret.strip()
|
||||
if not ret:
|
||||
return default
|
||||
ret = int(ret)
|
||||
|
Loading…
Reference in New Issue
Block a user