WIP: Fix Version compatible and refactor check_cluster_conf_ssh#310
Open
Dawei-Pang wants to merge 1 commit intoClusterLabs:masterfrom
Open
WIP: Fix Version compatible and refactor check_cluster_conf_ssh#310Dawei-Pang wants to merge 1 commit intoClusterLabs:masterfrom
Dawei-Pang wants to merge 1 commit intoClusterLabs:masterfrom
Conversation
badboywj
reviewed
Mar 17, 2026
| if ssh.is_valid_command("crm_attribute --list-options=cluster --all --output-as=xml"): | ||
| if not ssh.check_cluster_conf_ssh("crm_attribute --list-options=cluster --all --output-as=xml | grep 'advanced=\"0\"' | sed 's/.*name=\"*\\([^\\\"]*\\)\".*/\\1/'", lst, silent=True, anycheck=False): | ||
| out = ssh.get_cluster_conf_ssh_output("crm_attribute --list-options=cluster --all --output-as=xml | grep 'advanced=\"0\"' | sed 's/.*name=\"*\\([^\\\"]*\\)\".*/\\1/'") | ||
| if not all(_ in out for _ in lst): |
Contributor
There was a problem hiding this comment.
it means that out must be iterable (like list/dict), we also need to consider out is possibly string type.
badboywj
reviewed
Mar 17, 2026
| return True | ||
|
|
||
| def check_cluster_conf_ssh(self, command, mustmatch, silent=False, anycheck=False): | ||
| def get_cluster_conf_ssh_output(self, command): |
Contributor
There was a problem hiding this comment.
just a reminder: please make sure update all of check_cluster_conf_ssh to get_cluster_conf_ssh_output in this project
badboywj
reviewed
Mar 17, 2026
| print(f"TEST: verify_primitive_removed: check primitive [{primitive}] is removed") | ||
| if self.check_cluster_conf_ssh("crm resource status | grep ocf::heartbeat:Dummy", ''): | ||
| out = self.get_cluster_conf_ssh_output("crm resource status | grep ocf::heartbeat:Dummy") | ||
| if out == '': |
Contributor
There was a problem hiding this comment.
the logic is different with the lines in the original function:
if isinstance(mustmatch, str):
return mustmatch in out
please make sure out must be '' rather than ['a', 'b', ''], {'apple', ''}, {'': 'empty key value', 'id': 123} or any string.
d55316c to
cf16d8d
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Attempt to address https://jira.suse.com/browse/TEAM-11049 and https://jira.suse.com/browse/TEAM-9132