HomeClusterLabs Projects

Low: fencer: don't require API registration for list and status commands

Description

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.

Details

Provenance
kgaillotAuthored on Feb 21 2019, 5:54 PM
Parents
rP652f582112b6: Low: fencer: improve error checking and log messages for API action requests
Branches
Unknown
Tags
Unknown

Event Timeline