Temlate CG Bug Fixes#38
Merged
Merged
Conversation
madhansansel
approved these changes
Jun 24, 2026
| """ | ||
|
|
||
| self.log( | ||
| "Starting template params transformation for template: {0}".format( |
There was a problem hiding this comment.
self.log("Transforming template params for template '{0}'.".format(...), "DEBUG")
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.
Type of Change
Issue 1:
template_paramsnot generated in template outputIssue: Generated YAML for templates did not include
template_params, even thoughtemplate_workflow_manageruses them for parameter configuration (binding, data_type, default_value, range, selection, etc.).RCA:
templates_temp_spec()did not have atemplate_paramsfield definition. Additionally, the base classcamel_to_snake_case()method (used for the transform) preservedNonevalues in the output, which would producenullentries in the YAML.Fix:
template_paramstotemplates_temp_spec()withspecial_handling: Trueand atransform_template_paramsmethod that usescamel_to_snake_case()for recursive camelCase-to-snake_case conversion.camel_to_snake_case()inplugins/module_utils/catalystcenter.pyto skip entries withNonevalues (if new_value is not None:check).Issue 2:
project_descriptionmissing from template outputIssue: Generated YAML for templates includes
project_namebut notproject_description, whichtemplate_workflow_manageraccepts.RCA:
get_templates_detailsAPI returnsprojectNamebut notprojectDescription. The description is only available from the separateget_projects_detailsAPI.Fix: Added
project_descriptiontotemplates_temp_specwith atransform_project_descriptionmethod that looks up descriptions from a lazily-initializedproject_description_map. The map is pre-cached when projects are fetched first, or lazily fetched viaget_template_projects_detailswhen only templates are requested.Testing Done:
Test cases covered: [Mention test case IDs or brief points]
Checklist
Ansible Best Practices
ansible-vaultor environment variables)Documentation
Screenshots (if applicable)
Notes to Reviewers