HomeClusterLabs Projects

Fix: libcrmcommon: Add a way for custom messages to manage lists.

Description

Fix: libcrmcommon: Add a way for custom messages to manage lists.

Typically, list_item is called to add items to a list. This causes the
length counter to be incremented so the list footer can be added at the
end. However, custom messages sometimes add items to a list without
calling list_item. They may call pcmk__indented_printf instead and
count on the item to look like it's in a list (because it's indented and
gets the bullet point). The counter won't get incremented this way.

The new increment_list function is a way for custom messages to make
sure the list length is correct. It is added as a function pointed on
pcmk__output_t instead of its own standalone function because only some
formatters keep track of the list length, yet we want to be able to call
it without caring what format is being used.

Details

Provenance
clumensAuthored on Oct 15 2019, 4:37 PM
kgaillotCommitted on Oct 18 2019, 10:46 AM
Parents
rP526d16fb0fde: Fix: tools: Remove mon_state_t.
Branches
Unknown
Tags
Unknown

Event Timeline