Currently, we require both --force and --force-multiple for skipping the
confirmation on instance reinstalls. After offline conversations, this
has been deemed to be excessive, and this patch changes the meaning of
--force-multiple to be a “stronger” force, and not require both.
So, to skip the prompts:
- single instance reinstallation requires either --force or
--force-multiple
- multiple instance reinstallation requires --force-multiple
---
man/gnt-instance.sgml | 3 +--
scripts/gnt-instance | 9 +++++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/man/gnt-instance.sgml b/man/gnt-instance.sgml
index dd88052..60d8315 100644
--- a/man/gnt-instance.sgml
+++ b/man/gnt-instance.sgml
@@ -1633,8 +1633,7 @@ instance5: 11225
are selected (either by passing multiple arguments or by
using the <option>--node</option>,
<option>--primary</option>, <option>--secondary</option> or
- <option>--all</option> options), the user must pass both the
- <option>--force</option> and
+ <option>--all</option> options), the user must pass the
<option>--force-multiple</option> options to skip the
interactive confirmation.
</para>
diff --git a/scripts/gnt-instance b/scripts/gnt-instance
index ec19602..75ecd63 100755
--- a/scripts/gnt-instance
+++ b/scripts/gnt-instance
@@ -559,16 +559,17 @@ def ReinstallInstance(opts, args):
else:
os_name = opts.os
- # third, get confirmation: multi-reinstall requires --force-multi
- # *and* --force, single-reinstall just --force
+ # third, get confirmation: multi-reinstall requires --force-multi,
+ # single-reinstall either --force or --force-multi (--force-multi is
+ # a stronger --force)
multi_on = opts.multi_mode != _SHUTDOWN_INSTANCES or len(inames) > 1
if multi_on:
warn_msg = "Note: this will remove *all* data for the below instances!\n"
- if not ((opts.force_multi and opts.force) or
+ if not (opts.force_multi or
_ConfirmOperation(inames, "reinstall", extra=warn_msg)):
return 1
else:
- if not opts.force:
+ if not (opts.force or opts.force_multi):
usertext = ("This will reinstall the instance %s and remove"
" all data. Continue?") % inames[0]
if not AskUser(usertext):
--
1.7.1