Skip to content

Temlate CG Bug Fixes#38

Merged
madhansansel merged 1 commit into
mainfrom
template_cg_bug_fixes
Jun 24, 2026
Merged

Temlate CG Bug Fixes#38
madhansansel merged 1 commit into
mainfrom
template_cg_bug_fixes

Conversation

@shatagopasunil

Copy link
Copy Markdown

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Issue 1: template_params not generated in template output

Issue: Generated YAML for templates did not include template_params, even though template_workflow_manager uses them for parameter configuration (binding, data_type, default_value, range, selection, etc.).

RCA: templates_temp_spec() did not have a template_params field definition. Additionally, the base class camel_to_snake_case() method (used for the transform) preserved None values in the output, which would produce null entries in the YAML.

Fix:

  • Added template_params to templates_temp_spec() with special_handling: True and a transform_template_params method that uses camel_to_snake_case() for recursive camelCase-to-snake_case conversion.
  • Fixed camel_to_snake_case() in plugins/module_utils/catalystcenter.py to skip entries with None values (if new_value is not None: check).

Issue 2: project_description missing from template output

Issue: Generated YAML for templates includes project_name but not project_description, which template_workflow_manager accepts.

RCA: get_templates_details API returns projectName but not projectDescription. The description is only available from the separate get_projects_details API.

Fix: Added project_description to templates_temp_spec with a transform_project_description method that looks up descriptions from a lazily-initialized project_description_map. The map is pre-cached when projects are fetched first, or lazily fetched via get_template_projects_details when only templates are requested.

Testing Done:

  • Manual testing
  • Unit tests
  • [] Integration tests

Test cases covered: [Mention test case IDs or brief points]

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • All the sanity checks have been completed and the sanity test cases have been executed

Ansible Best Practices

  • Tasks are idempotent (can be run multiple times without changing state)
  • Variables and secrets are handled securely (e.g., using ansible-vault or environment variables)
  • Playbooks are modular and reusable
  • Handlers are used for actions that need to run on change

Documentation

  • All options and parameters are documented clearly.
  • Examples are provided and tested.
  • Notes and limitations are clearly stated.

Screenshots (if applicable)

Notes to Reviewers

"""

self.log(
"Starting template params transformation for template: {0}".format(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

self.log("Transforming template params for template '{0}'.".format(...), "DEBUG")

@madhansansel madhansansel merged commit ca5437d into main Jun 24, 2026
23 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.

2 participants