Follow-up check-errors flag

This patch fixes some nits from If30fdb9b8dbe29eb6803dafcde9380444e497e3d

Change-Id: I8aaafd4e47939d29cda104b25b5890323a9b856a
This commit is contained in:
Iury Gregory Melo Ferreira 2018-11-28 11:39:43 +01:00
parent 129594ef55
commit c4a597318e
3 changed files with 11 additions and 6 deletions

View File

@ -36,8 +36,13 @@ Note that the CLI call accepts several UUID's and will stop on the first error.
With ``--wait`` flag it waits until introspection ends for all given nodes,
then displays the results as a table.
The ``--check-errors`` flag can only be used together with the ``--wait`` flag,
otherwise will throw an error.
The ``--check-errors`` flag verifies if any error occurred during the
introspection of the selected nodes while waiting for the results. If any error
has occurred in the introspection result of selected nodes no output is
displayed, otherwise it shows the result as a table.
.. note::
``--check-errors`` can only be used with ``--wait``
Query introspection status
--------------------------

View File

@ -77,7 +77,8 @@ class StartCommand(command.Lister):
action='store_true',
help='check if errors occurred during the'
' introspection; if any error occurs only the'
' errors are displayed')
' errors are displayed; can only be used with'
' --wait')
return parser
def take_action(self, parsed_args):
@ -95,7 +96,7 @@ class StartCommand(command.Lister):
result = [(uuid, s.get('error'))
for uuid, s in result.items()]
if parsed_args.check_errors:
uuids_errors = ", ".join("%s (%s)" % node_info
uuids_errors = "\n".join("%s (%s)" % node_info
for node_info in result
if node_info[1] is not None)
if uuids_errors:

View File

@ -5,5 +5,4 @@ features:
waiting for the introspection to finish for the selected nodes.
If any error occurs no output is displayed and the exit status for the
command is different from 0 (success).
If ``--check-errors`` is used without the ``--wait`` a CommandError is
thrown.
The ``--check-errors`` option can only be used with ``--wait``.