Merged
Conversation
dmytrotkk
approved these changes
Jul 21, 2025
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.
This pull request introduces changes to improve the cleanup processes for single-chain nodes and adds a new utility function for directory content removal. The most significant updates include enhancements to the
cleanup_datadir_for_single_chain_nodefunction, the addition ofcleanup_dir_content, and updates to thecleanupfunction innode_cli/operations/fair.py.Cleanup process improvements:
Enhanced
cleanup_datadir_for_single_chain_node: Modified the logic to iterate over folder names and exclude theshared-spacefolder when removing regular folders. This ensures more precise cleanup behavior. (node_cli/core/schains.py, node_cli/core/schains.pyL266-R268)Updated
cleanupfunction: Added a call tocleanup_dir_contentto remove contents of theNFTABLES_CHAIN_FOLDER_PATHdirectory during cleanup, improving resource management. (node_cli/operations/fair.py, node_cli/operations/fair.pyR248)Utility function addition:
cleanup_dir_contentfunction: Introduced a helper function to remove all contents within a specified directory, including files, links, and subdirectories. This provides a reusable and efficient way to clean directories. (node_cli/utils/helper.py, node_cli/utils/helper.pyR327-R337)Code organization improvements:
cleanup_dir_content: Updated imports innode_cli/operations/fair.pyto include the newly addedcleanup_dir_contentfunction, ensuring its availability for cleanup operations. (node_cli/operations/fair.py, node_cli/operations/fair.pyL58-R59)node_cli/operations/fair.pyfor better readability and adherence to coding standards. (node_cli/operations/fair.py, node_cli/operations/fair.pyL39-R41)