Dev: corosync: Default 'crm corosync status' to all components (#2038)#2122
Dev: corosync: Default 'crm corosync status' to all components (#2038)#2122nicholasyang2022 wants to merge 1 commit into
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Updates the crm corosync status command to display health information for all corosync-related components by default (instead of only ring), aligning behavior with the expectation in #2038.
Changes:
- Default
crm corosync statusto query and print status for all supported components. - Move
COROSYNC_STATUS_TYPESintocrmsh/corosync.pyand introduce aSTATUS_FUNC_DICTdispatch table. - Replace
crm_node -lexecution viacluster_shell()with a directsubprocess.run()call, and add fail-fast behavior when node status query fails.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| test/unittests/test_corosync.py | Updates/extends unit tests for the new default “all components” behavior and new error handling paths. |
| crmsh/ui_corosync.py | Changes corosync status default argument to query all components and updates completer source. |
| crmsh/corosync.py | Refactors status querying to support “all by default”, adds dispatch dict/constants, and switches crm_node -l to subprocess.run. |
| crmsh/constants.py | Removes COROSYNC_STATUS_TYPES constant after moving it to corosync.py. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| STATUS_FUNC_DICT = { | ||
| "ring": query_ring_status, | ||
| "quorum": query_quorum_status, | ||
| "qdevice": query_qdevice_status, | ||
| "cpg": query_cpg_status, | ||
| "qnetd": query_qnetd_status, | ||
| } | ||
|
|
||
| COROSYNC_STATUS_TYPES = tuple(STATUS_FUNC_DICT.keys()) | ||
|
|
…erLabs#2038) - Update 'crm corosync status' to show all components by default - Refactor COROSYNC_STATUS_TYPES from constants.py to corosync.py - Optimize crm_node -l to use subprocess.run directly - Ensure ValueError is raised on status query failures for 'fail fast' behavior Fixes: ClusterLabs#2038
dbbdae6 to
f6571cf
Compare
|
This PR targets to v5.2. |
|
I'd prefer the output to be a little more self-explained to its usage. Something as below, |
I tried this and it is not quite readable. Currently, subcommands like |
Fixes: #2038