Blame SOURCES/virt-manager-Warn-that-prompt-mode-will-likely-be-removed-in-the-.patch

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