Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:15
pacemaker.19404
bsc#1148236-0002-Low-fencer-don-t-require-API-r...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bsc#1148236-0002-Low-fencer-don-t-require-API-registration-for-list-a.patch of Package pacemaker.19404
From eaee0fc4e92004b46c38919ddde9f542d17697be Mon Sep 17 00:00:00 2001 From: Ken Gaillot <kgaillot@redhat.com> Date: Thu, 21 Feb 2019 16:54:26 -0600 Subject: [PATCH 2/2] Low: fencer: don't require API registration for list and status commands Previously, stonith_device_action() (which handles STONITH_OP_EXEC requests, sent for API list, monitor, and status calls) would always return "No such device" if the device was registered only via the CIB, and not via the API. While this could make sense for monitor, which conceivably should not succeed unless the device has been "started" (i.e. registered via the API), the list and status commands should be direct agent calls. Another side effect of the old code was that list, monitor, and status calls could only succeed when run on the node "running" the stonith device. That is, running something like "stonith_admin --list-targets $DEVICE" on some other node would always fail, even though there's no reason for it to. Now, that command would work when run from any node. This leaves the old behavior for monitor, but it is a good question whether that's ideal. For the specific case of "stonith_admin --query", it makes an API monitor call, and if that fails, tries an API list call. So, on a node "running" the device, it will return success if the monitor succeeds, but that will always fail on other nodes, and it will return the result of list instead. --- fencing/commands.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) Index: pacemaker-1.1.18+20180430.b12c320f5/fencing/commands.c =================================================================== --- pacemaker-1.1.18+20180430.b12c320f5.orig/fencing/commands.c +++ pacemaker-1.1.18+20180430.b12c320f5/fencing/commands.c @@ -1563,6 +1563,9 @@ stonith_level_remove(xmlNode *msg, char * \param[out] output Unused * * \return -EINPROGRESS on success, -errno otherwise + * \note If the action is monitor, the device must be registered via the API + * (CIB registration is not sufficient), because monitor should not be + * possible unless the device is "started" (API registered). */ static int stonith_device_action(xmlNode * msg, char **output) @@ -1582,7 +1585,10 @@ stonith_device_action(xmlNode * msg, cha } device = g_hash_table_lookup(device_list, id); - if ((device == NULL) || !device->api_registered) { + if ((device == NULL) + || (!device->api_registered && !strcmp(action, "monitor"))) { + + // Monitors may run only on "started" (API-registered) devices crm_info("Ignoring API %s action request because device %s not found", action, id); return -ENODEV;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor