diff options
author | John Estabrook <jestabro@vyos.io> | 2024-04-16 20:16:03 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-16 20:16:03 -0500 |
commit | ce7023bea759b44307a78a4b0bab52a9a79ec088 (patch) | |
tree | 8d142b0e80125457a4e78c2479c66299547e500d /python | |
parent | 6825873bd1e835836259094a5a7d666be8f0be6e (diff) | |
parent | f43edbd7cd36f52a0cd9c475b53f317882f4a6f9 (diff) | |
download | vyos-1x-ce7023bea759b44307a78a4b0bab52a9a79ec088.tar.gz vyos-1x-ce7023bea759b44307a78a4b0bab52a9a79ec088.zip |
Merge pull request #3321 from jestabro/confirm-pass
image-tools: T6154: installer prompts to confirm password
Diffstat (limited to 'python')
-rw-r--r-- | python/vyos/utils/io.py | 5 |
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 |