Skip to content

Remove warning when rendering non-SLS files#67067

Open
amendlik wants to merge 3 commits intosaltstack:masterfrom
amendlik:sls-context
Open

Remove warning when rendering non-SLS files#67067
amendlik wants to merge 3 commits intosaltstack:masterfrom
amendlik:sls-context

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

@amendlik amendlik requested a review from a team as a code owner November 25, 2024 15:21
twangboy
twangboy previously approved these changes Feb 12, 2025
@twangboy twangboy added this to the Argon v3008.0 milestone Feb 12, 2025
@dwoz dwoz added the test:full Run the full test suite label Jun 26, 2025
This function contained a bug that was comparing actual to actual, so
every test always passed.
Rather than logging a warning, just populate some of the context
variables with appropriate values.
@dwoz
Copy link
Contributor

dwoz commented Jan 30, 2026

@amendlik Can you please resolve the conflict?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants