Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove warning when rendering non-SLS files #67067

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

amendlik
Copy link
Contributor

What does this PR do?

My Salt states contain code to render Jinja in YAML files using the slsutil.renderer function, such as:

{% set defaults = salt["slsutil.renderer"]("salt://defaults.yaml", sls="defaults.yaml") %}

This works fine, but it always produces the error message: "Failed to determine proper template path"

What issues does this PR fix or reference?

None

Previous Behavior

Running slsutil.renderer on any file other than an SLS file would work, but produce a superfluous warning.

New Behavior

Running slsutil.renderer on non-SLS files succeeds without a warning, and populates the following context variables:

  • tplpath
  • tplfile
  • tpldir

Merge requirements satisfied?

Commits signed with GPG?

Yes

This function contained a bug that was comparing actual to actual, so
every test always passed.
@amendlik amendlik requested a review from a team as a code owner November 25, 2024 15:21
Rather than logging a warning, just populate some of the context
variables with appropriate values.
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