diff --git a/virtualbox/pybox/Parser.py b/virtualbox/pybox/Parser.py index 06e10d1..5cd520b 100644 --- a/virtualbox/pybox/Parser.py +++ b/virtualbox/pybox/Parser.py @@ -314,7 +314,7 @@ def parse_networking(parser: ArgumentParser): """, type=str, default='32000') - parser.add_argument("-y", "--yes-to-all", help= + parser.add_argument("-y", "--yes-to-all", dest="y", help= """ Automatically answers all yes/no prompts with yes. """, diff --git a/virtualbox/pybox/install_vbox.py b/virtualbox/pybox/install_vbox.py index 91fd376..11f53bd 100755 --- a/virtualbox/pybox/install_vbox.py +++ b/virtualbox/pybox/install_vbox.py @@ -284,9 +284,11 @@ def yes_no_prompt(message): Returns: Answer to the prompt(bool) """ - if V_BOX_OPTIONS.y == True: + question = message + " (y/n)" + if V_BOX_OPTIONS.y is True: + LOG.info("Automatically answering 'y' to '%s'", question) return True - LOG.info("%s (y/n)",message) + LOG.info("%s", question) choice = input().lower() if choice == 'y': return True @@ -331,7 +333,7 @@ def create_port_forward(hostname, network, local_port, guest_port, guest_ip): ) else: LOG.info("Ignoring the creation of the port-forward rule and continuing installation!") - + # pylint: disable=too-many-locals, too-many-branches, too-many-statements