summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2024-04-16 20:25:35 -0500
committerGitHub <noreply@github.com>2024-04-16 20:25:35 -0500
commit06a08f61abb958b0a932ddd35351cedd02afbe2c (patch)
tree1dd7bc550940880195e401b943db42adecf33a34 /python
parent8f778f989d8fed30eec0a95d5b1fbb67594c67df (diff)
parentabfd626653593357190026a54b75257cdedee5f5 (diff)
downloadvyos-1x-06a08f61abb958b0a932ddd35351cedd02afbe2c.tar.gz
vyos-1x-06a08f61abb958b0a932ddd35351cedd02afbe2c.zip
Merge pull request #3322 from vyos/mergify/bp/sagitta/pr-3321
image-tools: T6154: installer prompts to confirm password (backport #3321)
Diffstat (limited to 'python')
-rw-r--r--python/vyos/utils/io.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/python/vyos/utils/io.py b/python/vyos/utils/io.py
index 7e6045291..a8c430f28 100644
--- a/python/vyos/utils/io.py
+++ b/python/vyos/utils/io.py
@@ -27,7 +27,7 @@ def print_error(str='', end='\n'):
sys.stderr.flush()
def ask_input(question, default='', numeric_only=False, valid_responses=[],
- no_echo=False):
+ no_echo=False, non_empty=False):
from getpass import getpass
question_out = question
if default:
@@ -48,6 +48,9 @@ def ask_input(question, default='', numeric_only=False, valid_responses=[],
if valid_responses and response not in valid_responses:
print("Invalid value, try again.")
continue
+ if non_empty and not response:
+ print("Non-empty value required; try again.")
+ continue
break
return response