From b43a8f932c50f4ed82b2a5fbeaf319891a9810d2 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Sat, 28 Sep 2013 11:34:03 -0400 Subject: [PATCH 1/2] Warn that --prompt mode will likely be removed in the future. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1060571 (cherry picked from commit d414beb3a9068ed78eeb02e0a6d4a3461ad3cf85) Signed-off-by: Giuseppe Scrivano --- man/virt-clone.pod | 14 +------------- man/virt-install.pod | 14 +------------- virt-image | 1 - virtinst/cli.py | 7 +++++-- 4 files changed, 7 insertions(+), 29 deletions(-) diff --git a/man/virt-clone.pod b/man/virt-clone.pod index 21c3e68..cf770c4 100644 --- a/man/virt-clone.pod +++ b/man/virt-clone.pod @@ -18,9 +18,7 @@ uniqueness will be updated to avoid a clash between old and new guests. By default, virt-clone will show an error if the necessary information to clone the guest is not provided. The --auto-clone option will generate -all needed input, aside from the source guest to clone. An interactive mode -is available with the --prompt option, but this will only ask for the -minimum required options. +all needed input, aside from the source guest to clone. =head1 OPTIONS @@ -149,16 +147,6 @@ Print debugging information to the terminal when running the install process. The debugging information is also stored in C<$HOME/.virtinst/virt-clone.log> even if this parameter is omitted. -=item --force - -Prevent interactive prompts. If the intended prompt was a yes/no prompt, always -say yes. For any other prompts, the application will exit. - -=item --prompt - -Specifically enable prompting for required information. Default prompting -is off. - =back =head1 EXAMPLES diff --git a/man/virt-install.pod b/man/virt-install.pod index 56049e5..ae1cea8 100644 --- a/man/virt-install.pod +++ b/man/virt-install.pod @@ -27,9 +27,7 @@ an existing disk image (thus skipping the install phase) are also supported. Given suitable command line arguments, C is capable of running completely unattended, with the guest 'kickstarting' itself too. This allows -for easy automation of guest installs. An interactive mode is also available -with the --prompt option, but this will only ask for the minimum required -options. +for easy automation of guest installs. =head1 OPTIONS @@ -1294,11 +1292,6 @@ value will make virt-install wait indefinitely, a value of 0 triggers the same results as noautoconsole. If the time limit is exceeded, virt-install simply exits, leaving the virtual machine in its current state. -=item --force - -Prevent interactive prompts. If the intended prompt was a yes/no prompt, always -say yes. For any other prompts, the application will exit. - =item --dry-run Proceed through the guest creation process, but do NOT create storage devices, @@ -1306,11 +1299,6 @@ change host device configuration, or actually teach libvirt about the guest. virt-install may still fetch install media, since this is required to properly detect the OS to install. -=item --prompt - -Specifically enable prompting for required information. Default prompting -is off (as of virtinst 0.400.0) - =item --check-cpu Check that the number virtual cpus requested does not exceed physical CPUs and diff --git a/virt-image b/virt-image index 824ae96..8b1c2f2 100755 --- a/virt-image +++ b/virt-image @@ -132,7 +132,6 @@ def main(conn=None): options.quiet = options.print_only or options.quiet cli.setupLogging("virt-image", options.debug, options.quiet) - cli.set_prompt(False) if conn is None: conn = cli.getConnection(options.connect) diff --git a/virtinst/cli.py b/virtinst/cli.py index 7c4912a..6952ba8 100644 --- a/virtinst/cli.py +++ b/virtinst/cli.py @@ -537,10 +537,13 @@ def set_force(val=True): force = val -def set_prompt(prompt=True): +def set_prompt(prompt): # Set whether we allow prompts, or fail if a prompt pops up global doprompt doprompt = prompt + if prompt: + logging.warning("--prompt mode is barely supported and likely to " + "be removed in a future release.\n") def is_prompt(): @@ -588,7 +591,7 @@ def prompt_for_yes_or_no(warning, question): logging.debug("Forcing return value of True to prompt '%s'") return True - errmsg = warning + _(" (Use --prompt or --force to override)") + errmsg = warning + _(" (Use --force to override)") while 1: msg = warning -- 1.8.5.3