Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop deprecated codes #1723

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

liangxin1300
Copy link
Collaborator

@liangxin1300 liangxin1300 commented Mar 24, 2025

  • Dev: Drop node type normal and ping
    According to the nodes-4.0.rng schema, only supports node type "member" and "remote"
  • Dev: Remove codes that include rhcs term
  • Dev: ra: Drop legacy codes to fetch ra informations

@liangxin1300 liangxin1300 force-pushed the 20250324_drop_node_ping branch 2 times, most recently from 01b721c to 9ea6be2 Compare March 24, 2025 09:23
@liangxin1300 liangxin1300 marked this pull request as ready for review March 24, 2025 09:25
@liangxin1300 liangxin1300 requested a review from zzhou1 March 24, 2025 09:25
@liangxin1300 liangxin1300 force-pushed the 20250324_drop_node_ping branch from 9ea6be2 to 328d9b3 Compare March 25, 2025 03:29
@liangxin1300 liangxin1300 changed the title Dev: doc: Drop node type normal and ping Dev: Drop node type normal and ping Mar 25, 2025
@liangxin1300 liangxin1300 changed the title Dev: Drop node type normal and ping Drop deprecated codes Mar 26, 2025
@liangxin1300 liangxin1300 requested a review from Copilot March 28, 2025 01:43
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes deprecated code related to node types and legacy RA ("Resource Agent") handling. Key changes include:

  • Dropping support for "normal" and "ping" node types in favor of "member" and "remote".
  • Removing legacy code involving "rhcs" terminology and fallback logic for metadata retrieval.
  • Eliminating unused functions such as os_types_list to clean up the codebase.

Reviewed Changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/unittests/test_parse.py Updated tests to use "remote" instead of deprecated "ping".
crmsh/xmlutil.py Removed "normal" type check; only "member" is now considered valid.
crmsh/utils.py Removed unused os_types_list function.
crmsh/rsctest.py Removed legacy "rhcs" handling and adjusted error messages.
crmsh/ra.py Dropped legacy logic for RA metadata retrieval and fallback functions.
crmsh/parse.py Updated regex and documentation to restrict node types to "member" and "remote".
crmsh/constants.py Changed default node type from "normal" to "member".
Files not reviewed (1)
  • doc/crm.8.adoc: Language not supported
Comments suppressed due to low confidence (2)

crmsh/xmlutil.py:328

  • [nitpick] The function name is_normal_node is now misleading since it no longer considers the 'normal' node type; consider renaming the function or updating its documentation to reflect that it only checks for 'member' nodes.
return n.tag == "node" and (n.get("type") in (None, "member", ""))

crmsh/ra.py:107

  • The removal of the fallback branch in the ra_meta function may lead to missing metadata if crm_resource fails; verify that crm_resource reliably returns valid metadata in all environments or consider retaining a fallback mechanism.
return crm_resource("--show-metadata %s:%s" % (ra_class, ra_type))

@liangxin1300 liangxin1300 force-pushed the 20250324_drop_node_ping branch from bedc5d9 to 5128a33 Compare March 28, 2025 01:56
@liangxin1300 liangxin1300 requested a review from Copilot March 28, 2025 01:56
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes deprecated code related to obsolete node types and legacy resource agent handling. The changes update tests, XML utility functions, error messages, and regular expressions to support only the modern node types "member" and "remote", while also removing legacy references to "rhcs" and related fallback code.

Reviewed Changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/unittests/test_parse.py Updated test strings and assertions to use only "member" and "remote".
crmsh/xmlutil.py Renamed the node type check function to reflect the supported types.
crmsh/utils.py Removed the obsolete os_types_list function.
crmsh/ui_configure.py Updated the function call to use the new is_member_node check.
crmsh/rsctest.py Removed legacy checks for 'rhcs/' and updated error messages.
crmsh/ra.py Removed legacy fetching logic and fallback methods for resource agents.
crmsh/parse.py Updated regex and documentation to limit valid node types.
crmsh/constants.py Changed default node type from "normal" to "member".
Files not reviewed (1)
  • doc/crm.8.adoc: Language not supported

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant