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

Update Salt to work with Jinja >= and <= 3.1.0 #61856

Merged
merged 5 commits into from Mar 30, 2022

Conversation

Ch3LL
Copy link
Contributor

@Ch3LL Ch3LL commented Mar 25, 2022

What does this PR do?

Updates Markup and contextfunction to work with all versions of Jinja2. Markup was moved to markupsafe and contextfunction was changed to pass_context in Jinja 3.1

What issues does this PR fix or reference?

Fixes: #61848 #60745

@Ch3LL Ch3LL requested a review from a team as a code owner March 25, 2022 15:43
@Ch3LL Ch3LL requested review from waynew and removed request for a team March 25, 2022 15:43
salt/utils/jinja.py Outdated Show resolved Hide resolved
salt/utils/jinja.py Outdated Show resolved Hide resolved
twangboy
twangboy previously approved these changes Mar 25, 2022
@twangboy twangboy requested a review from s0undt3ch March 25, 2022 21:02
s0undt3ch
s0undt3ch previously approved these changes Mar 25, 2022
@s0undt3ch s0undt3ch dismissed stale reviews from twangboy and themself via 0f44243 March 28, 2022 04:04
@krionbsd
Copy link
Contributor

re-run all

waynew
waynew previously approved these changes Mar 28, 2022
@myii
Copy link
Contributor

myii commented Mar 29, 2022

I've used this patch when building the master branch images for this week's testing across the Formulas' org -- all seems to be working well, thanks.

@myii
Copy link
Contributor

myii commented Mar 29, 2022

Perhaps this will also close #60745 -- I haven't tested that.

@MKLeb
Copy link
Contributor

MKLeb commented Mar 29, 2022

re-run all

@github-actions
Copy link

Hi! I'm your friendly PR bot!

You might be wondering what I'm doing commenting here on your PR.

Yes, as a matter of fact, I am...

I'm just here to help us improve the documentation. I can't respond to
questions or anything, but what I can do, I do well!

Okay... so what do you do?

I detect modules that are missing docstrings or "CLI Example" on existing docstrings!
When I was created we had a lot of these. The documentation for these
modules need some love and attention to make Salt better for our users.

So what does that have to do with my PR?

I noticed that in this PR there are some files changed that have some of these
issues. So I'm leaving this comment to let you know your options.

Okay, what are they?

Well, my favorite, is that since you were making changes here I'm hoping that
you would be the most familiar with this module and be able to add some other
examples or fix any of the reported issues.

If I can, then what?

Well, you can either add them to this PR or add them to another PR. Either way is fine!

Well... what if I can't, or don't want to?

That's also fine! We appreciate all contributions to the Salt Project. If you
can't add those other examples, either because you're too busy, or unfamiliar,
or you just aren't interested, we still appreciate the contributions that
you've made already.

Whatever approach you decide to take, just drop a comment here letting us know!

Detected Issues (click me)
Check Known Missing Docstrings...........................................Failed
- hook id: invoke
- duration: 1.05s
- exit code: 1

The function 'jinja_raise' on 'salt/utils/jinja.py' does not have a docstring
The function 'regex_escape' on 'salt/utils/jinja.py' does not have a docstring
The function 'method_call' on 'salt/utils/jinja.py' does not have a docstring
The function 'show_full_context' on 'salt/utils/jinja.py' does not have a docstring
Found 4 errors


Thanks again!

@garethgreenaway garethgreenaway merged commit bb610f7 into saltstack:master Mar 30, 2022
myii added a commit to myii/salt-bootstrap that referenced this pull request Apr 4, 2022
The fix for this has only just been merged into the `master` branch:

* saltstack/salt#61856
myii added a commit to myii/salt-bootstrap that referenced this pull request Apr 4, 2022
The fix for this has only just been merged into the `master` branch:

* saltstack/salt#61856
@jpic
Copy link
Contributor

jpic commented Apr 4, 2022

Great! Is this going to be backported on older salt versions?

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.

[BUG] Jinja 3.1 moved Markup
10 participants