Skip to content

Enhancements to run in offline mode#10

Merged
devanshjainms merged 10 commits intofeature/offline-modefrom
offline-feature
Jul 1, 2025
Merged

Enhancements to run in offline mode#10
devanshjainms merged 10 commits intofeature/offline-modefrom
offline-feature

Conversation

@devanshjainms
Copy link
Copy Markdown
Owner

This pull request introduces significant updates to the SAP automation scripts, focusing on improving portability, enhancing offline mode functionality, and centralizing utility functions. Key changes include the addition of offline mode support, refactoring shared utilities into a new utils.sh file, and improving error handling and logging.

Enhancements to Offline Mode:

  • Added support for offline mode in scripts/sap_automation_qa.sh, allowing tests to run using previously collected Cluster Information Base (CIB) data. This includes validation for the presence of required CIB files and adjustments to playbook selection based on offline mode. [1] [2] [3]

  • Updated the run_ansible_playbook() function to skip SSH authentication setup when offline mode is enabled, simplifying the command execution flow.

Refactoring and Centralization of Utility Functions:

  • Extracted commonly used functions such as log, command_exists, and check_file_exists into a new scripts/utils.sh file for better modularity and reuse across scripts.

  • Updated scripts/setup.sh and scripts/sap_automation_qa.sh to source utils.sh and use its centralized functions, removing redundant implementations of logging and command checks. [1] [2]

Improvements to Portability and Error Handling:

  • Enhanced portability in scripts/sap_automation_qa.sh by using more robust methods for determining script and project directories, and providing fallback mechanisms for systems without certain commands like readlink -f.

  • Improved error handling in various functions, including better validation for file existence and more descriptive error messages. [1] [2]

Updates to XML Parsing in Python Module:

  • Refined the parse_xml_output method in src/module_utils/sap_automation_qa.py to ensure it always returns an ET.Element, enhancing type consistency and reliability.

Miscellaneous Improvements:

  • Added detailed logging for setup completion, package installation, and virtual environment creation in scripts/setup.sh.

These changes collectively improve the maintainability, usability, and robustness of the SAP automation scripts.

@devanshjainms devanshjainms merged commit 51b70d8 into feature/offline-mode Jul 1, 2025
9 of 11 checks passed
@devanshjainms devanshjainms deleted the offline-feature branch July 1, 2025 23:34
@devanshjainms devanshjainms restored the offline-feature branch July 2, 2025 17:03
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