mirror of
https://github.com/thegeeklab/ansible-doctor.git
synced 2024-09-27 17:58:13 +00:00
fix not aborting overwrite dialog
This commit is contained in:
parent
97d39351e4
commit
1ad3f7b516
@ -1,4 +1,5 @@
|
||||
* BUGFIX
|
||||
* add `role_name` config option to overwrite name of the role
|
||||
* fix not aborting overwrite dialog
|
||||
* FEATURE
|
||||
* add basic hugo theme
|
||||
|
@ -88,8 +88,10 @@ class Generator:
|
||||
print(*files_to_overwite, sep="\n")
|
||||
|
||||
try:
|
||||
FileUtils.query_yes_no("Do you want to continue?")
|
||||
except ansibledoctor.Exception.InputError:
|
||||
if not FileUtils.query_yes_no("Do you want to continue?"):
|
||||
self.log.sysexit_with_message("Aborted...")
|
||||
except ansibledoctor.Exception.InputError as e:
|
||||
self.logger.debug(str(e))
|
||||
self.log.sysexit_with_message("Aborted...")
|
||||
|
||||
for file in self.template_files:
|
||||
|
@ -215,6 +215,6 @@ class FileUtils:
|
||||
try:
|
||||
# input() is safe in python3
|
||||
choice = input("{} {} ".format(question, prompt)) or default # nosec
|
||||
to_bool(choice)
|
||||
return to_bool(choice)
|
||||
except (KeyboardInterrupt, ValueError) as e:
|
||||
raise ansibledoctor.Exception.InputError("Error while reading input", e)
|
||||
|
Loading…
Reference in New Issue
Block a user