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