ctdb-tools: Improve printing of multi-line event script output
authorMartin Schwenke <mschwenke@ddn.com>
Wed, 12 Jul 2023 00:39:06 +0000 (10:39 +1000)
committerStefan Metzmacher <metze@samba.org>
Fri, 28 Jul 2023 10:48:33 +0000 (10:48 +0000)
commit7920d2ff627c6ef252e59b428236919ed0abb6ba
tree4ac67a70925858c5c5f07b1798ce9f8beb2a024b
parente3c0b72c340f86b1d6e4fd009d1082c7e477fd04
ctdb-tools: Improve printing of multi-line event script output

Multi-line output currently prints like this:

  OUTPUT: aaa
bbb
ccc

This is less beautiful than it could be.

Instead, print multi-line output with no inlining and each line
indented:

  OUTPUT:
    aaa
    bbb
    ccc

However, continue to inline single line output:

  OUTPUT: foo

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/event/event_tool.c
ctdb/tests/UNIT/eventd/etc-ctdb/events/random/02.enabled.script
ctdb/tests/UNIT/eventd/eventd_008.sh