-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[crmsh-4.6] Fix: report: crm report will hang if CIB contains invalid…
… configuraions (bsc#1229686) (#1518) ## Problem Command `crm report` will hang if CIB contains invalid configurations, like lack of `stonith-enabled=false` when there is no stonith device configured. ## Root cause When running `crm report`, crmsh tries to collect the output of `crm_verify`, by calling `get_stdout_or_raise_error`. `crm_verify` will return non 0 value, then `get_stdout_or_raise_error` will raise custom exception `CommandFailure`, which will be wrongly pickled between processes. ## Solution 1. Implementing the `__reduce__` method to provide custom pickling support. This method returns a tuple specifying how to reconstruct instances of CommandFailure during the unpickling process, ensuring all necessary arguments (`cmd`, `host`, `user`, `msg`) are correctly passed to the `__init__` method 2. When there is invalid configuration in cib as crm_verify complains, the error output should be recorded in the report result instead of just raising an exception
- Loading branch information
Showing
4 changed files
with
49 additions
and
8 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
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