-
Notifications
You must be signed in to change notification settings - Fork 342
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
3 changed files
with
255 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters