Skip to content

Enhancement for offline validation and Support for SUSE and REDHAT as management server#11

Merged
devanshjainms merged 16 commits intofeature/offline-validationfrom
offline-feature
Jul 3, 2025
Merged

Enhancement for offline validation and Support for SUSE and REDHAT as management server#11
devanshjainms merged 16 commits intofeature/offline-validationfrom
offline-feature

Conversation

@devanshjainms
Copy link
Copy Markdown
Owner

This pull request introduces several enhancements and refactors to the SAP automation scripts, focusing on modularization, offline testing capabilities, and improved error handling. Key changes include the addition of a utils.sh script for reusable utility functions, support for offline testing in sap_automation_qa.sh, and updates to package installation logic in setup.sh.

Enhancements to sap_automation_qa.sh:

  • Offline Testing Support:

    • Added the --offline flag to run test cases using pre-collected Cluster Information Base (CIB) data. Includes validation to ensure CIB files are present before proceeding. [1] [2]
    • Modified get_playbook_name to return offline-specific playbooks based on the OFFLINE_MODE flag.
    • Updated run_ansible_playbook to skip SSH authentication setup in offline mode.
  • Improved Portability and Error Handling:

    • Replaced hardcoded paths with dynamically determined script and project directories for better portability.
    • Enhanced error handling for missing virtual environments and added clear instructions for setup.

Modularization and Code Reuse:

  • Introduction of utils.sh:
    • Added reusable utility functions for logging, command existence checks, file validation, and package management.
    • Centralized color-coded logging and package installation logic to reduce duplication across scripts. [1] [2]

Updates to setup.sh:

  • Improved Package Installation:
    • Refactored package installation logic to use utils.sh functions, including distribution-specific mappings for package names.
    • Added validation for Python3 availability post-installation and improved virtual environment creation steps.

Code Refinements in src/module_utils/sap_automation_qa.py:

  • XML Parsing Update:
    • Simplified the parse_xml_output method to always return an ET.Element, removing the Optional type hint.

These changes collectively improve the modularity, maintainability, and functionality of the SAP automation scripts, making them more robust and user-friendly.

…le and ensure consistent os_family assignment
… logging; add utils.sh for shared functions. Update ha-config-offline.yml to change CIB file path to system_output.
…ks and tests for improved structure and functionality
…ng for package facts collection in HA configuration
@devanshjainms devanshjainms merged commit 0e3e230 into feature/offline-validation Jul 3, 2025
6 of 7 checks passed
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