Modify stonith action retrieval and improve test coverage #12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request includes changes to improve the handling of the STONITH (Shoot The Other Node In The Head) action retrieval and its associated tests. The main changes involve modifying the logic for determining the STONITH action and updating the corresponding tests to ensure proper functionality.
Improvements to STONITH action retrieval:
src/module_utils/get_cluster_status.py: Modified the_get_stonith_actionmethod to initialize thestonith_actionto "unknown" and updated the logic to check for specific actions ("reboot", "poweroff", "off") within the command output. Added logging for exceptions.Updates to tests:
tests/module_utils/get_cluster_status_test.py: Renamed thetest_get_stonith_actionmethod totest_get_stonith_action_rhel94and added a newtest_get_stonith_actionmethod to handle different return values. Updated the tests to assert the correctstonith_actionbased on the command output.Problem Statement
In RHEL94, we found that the STONITH action retrieval logic was not handling certain command output correctly, leading to incorrect action determination.
Until RHEL92 the command output had ":", from RHEL94, the command output now includes "=".
Solution Details
Implementation changes
Configuration updates
Documentation updates
OS: RHEL 9.4
Database Type: HANA
Test Cases
Checklist