HomeClusterLabs Projects

Refactor: Implement crm_mon's one shot mode with a library function.

This commit no longer exists in the repository. It may have been part of a branch which was deleted.

Description

Refactor: Implement crm_mon's one shot mode with a library function.

First, add minimal static versions of cib_connect, fencing_connect, and
pacemakerd_status. These functions do only as much as is necessary to
make a single request and display it. In particular, there's nothing
about event callbacks and main loops beyond what is absolutely
necessary. These versions are taken from what's already being done in
crm_mon, but cannot replace what's happening there.

Second, add a pcmk__output_cluster_status function. This takes a bunch
of arguments and basically does what mon_refresh_display in crm_mon
does.

Third, add a pcmk__status function. This basically does what the
existing one_shot function does - connect to the CIB and fencing if
required, call a function to do the display, and close connections
afterwards.

Having done this, one_shot can then just be turned into a wrapper around
pcmk__status that calls it, deals with error codes, and calls crm_mon's
clean_up function afterwards.

Details

Provenance
clumensAuthored on Jan 19 2022, 4:28 PM

Commit No Longer Exists

This commit no longer exists in the repository.