HomeClusterLabs Projects

Refactor: fencer: Best practices in update_cib_stonith_devices()

Description

Refactor: fencer: Best practices in update_cib_stonith_devices()

  • Remove some nesting.
  • Use const where possible.
  • Improve variable names and scope.
  • Use a macro for repeated string literal.
  • Use sizeof() - 1 instead of strlen() for string literal.
  • Remove unnecessary escaping of single quote within double quotes.
  • Copy only what is needed of the xpath string, if anything.
  • Log assertion on malformed patchset, since we created it in cib_perform_op().
  • Add a comment to clarify why we're (apparently) doing all this in the first place.

Keep the watchdog_device_update() comment as-is because I haven't looked
into it.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Sun, Mar 30, 5:20 AM
Parents
rP4bff815aca8b: Merge pull request #3857 from nrwahl2/nrwahl2-controller
Branches
Unknown
Tags
Unknown