Revision d5b031dc

b/lib/cli.py
82 82
  "EARLY_RELEASE_OPT",
83 83
  "ENABLED_HV_OPT",
84 84
  "ERROR_CODES_OPT",
85
  "FAILURE_ONLY_OPT",
85 86
  "FIELDS_OPT",
86 87
  "FILESTORE_DIR_OPT",
87 88
  "FILESTORE_DRIVER_OPT",
......
1363 1364
                              action="store_true",
1364 1365
                              help="Show machine name for every line in output")
1365 1366

  
1367
FAILURE_ONLY_OPT = cli_option("--failure-only", default=False,
1368
                              action="store_true",
1369
                              help=("Hide successful results and show failures"
1370
                                    " only (determined by the exit code)"))
1371

  
1366 1372

  
1367 1373
def _PriorityOptionCb(option, _, value, parser):
1368 1374
  """Callback for processing C{--priority} option.
b/lib/client/gnt_cluster.py
539 539

  
540 540
  for name in nodes:
541 541
    result = srun.Run(name, constants.SSH_LOGIN_USER, command)
542

  
543
    if opts.failure_only and result.exit_code == constants.EXIT_SUCCESS:
544
      # Do not output anything for successful commands
545
      continue
546

  
542 547
    ToStdout("------------------------------------------------")
543 548
    if opts.show_machine_names:
544 549
      for line in result.output.splitlines():
......
1524 1529
    "[-n node...] <filename>", "Copies a file to all (or only some) nodes"),
1525 1530
  "command": (
1526 1531
    RunClusterCommand, [ArgCommand(min=1)],
1527
    [NODE_LIST_OPT, NODEGROUP_OPT, SHOW_MACHINE_OPT],
1532
    [NODE_LIST_OPT, NODEGROUP_OPT, SHOW_MACHINE_OPT, FAILURE_ONLY_OPT],
1528 1533
    "[-n node...] <command>", "Runs a command on all (or only some) nodes"),
1529 1534
  "info": (
1530 1535
    ShowClusterConfig, ARGS_NONE, [ROMAN_OPT],
b/man/gnt-cluster.rst
59 59
    # gnt-cluster command -g default date
60 60

  
61 61
The ``-M`` option can be used to prepend the node name to all output
62
lines.
62
lines. The ``--failure-only`` option hides successful commands, making
63
it easier to see failures.
63 64

  
64 65
The command is executed serially on the selected nodes. If the
65 66
master node is present in the list, the command will be executed

Also available in: Unified diff