diff --git a/man/gnt-instance.sgml b/man/gnt-instance.sgml index 3ce0a9941937f0277888bca3bcb6cce784696919..af3e26d0a345438f4a276a4cac2a139e553d6e58 100644 --- a/man/gnt-instance.sgml +++ b/man/gnt-instance.sgml @@ -469,8 +469,8 @@ </cmdsynopsis> <para> - Starts one or more instances, depending on the - <option>--by-*</option> mode. The four available modes are: + Starts one or more instances, depending on the following + options. The four available modes are: <variablelist> <varlistentry> <term><option>--instance</option></term> @@ -514,10 +514,9 @@ </para> <para> - Note that although you can pass more than one - <option>--by-</option> option, the last one wins, so in - order to guarantee the desired result, don't pass more than - one such option. + Note that although you can pass more than one selection + option, the last one wins, so in order to guarantee the + desired result, don't pass more than one such option. </para> <para> @@ -534,8 +533,8 @@ <screen> # gnt-instance start instance1.example.com # gnt-instance start --extra single test1.example.com -# gnt-instance start --by-node node1.example.com node2.example.com -# gnt-instance start --by-cluster +# gnt-instance start --node node1.example.com node2.example.com +# gnt-instance start --all </screen> </para> </refsect3> @@ -578,7 +577,7 @@ Example: <screen> # gnt-instance shutdown instance1.example.com -# gnt-instance shutdown --by-cluster +# gnt-instance shutdown --all </screen> </para> </refsect3> diff --git a/scripts/gnt-instance b/scripts/gnt-instance index 9838b416763fdec5c66543c4f4ce80039f403983..231ea19a61479823b935fd051635c482dd49d7d9 100755 --- a/scripts/gnt-instance +++ b/scripts/gnt-instance @@ -333,6 +333,8 @@ def StartupInstance(opts, args): if opts.multi_mode is None: opts.multi_mode = _SHUTDOWN_INSTANCES inames = _ExpandMultiNames(opts.multi_mode, args) + if not inames: + raise errors.OpPrereqError("Selection filter does not match any instances") multi_on = opts.multi_mode != _SHUTDOWN_INSTANCES or len(inames) > 1 if not (opts.force_multi or not multi_on or _ConfirmOperation(inames, "startup")): @@ -357,6 +359,8 @@ def RebootInstance(opts, args): if opts.multi_mode is None: opts.multi_mode = _SHUTDOWN_INSTANCES inames = _ExpandMultiNames(opts.multi_mode, args) + if not inames: + raise errors.OpPrereqError("Selection filter does not match any instances") multi_on = opts.multi_mode != _SHUTDOWN_INSTANCES or len(inames) > 1 if not (opts.force_multi or not multi_on or _ConfirmOperation(inames, "reboot")): @@ -380,6 +384,8 @@ def ShutdownInstance(opts, args): if opts.multi_mode is None: opts.multi_mode = _SHUTDOWN_INSTANCES inames = _ExpandMultiNames(opts.multi_mode, args) + if not inames: + raise errors.OpPrereqError("Selection filter does not match any instances") multi_on = opts.multi_mode != _SHUTDOWN_INSTANCES or len(inames) > 1 if not (opts.force_multi or not multi_on or _ConfirmOperation(inames, "shutdown")): @@ -469,8 +475,7 @@ def FailoverInstance(opts, args): opts.multi_mode = _SHUTDOWN_INSTANCES inames = _ExpandMultiNames(opts.multi_mode, args) if not inames: - logger.ToStderr("No instances match the selected options") - return 1 + raise errors.OpPrereqError("Selection filter does not match any instances") multi_on = opts.multi_mode != _SHUTDOWN_INSTANCES or len(inames) > 1 if not (opts.force_multi or not multi_on or _ConfirmOperation(inames, "failover (including shutdown)")):