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

Avoid redundant unsafe wrapping in ansible_eval_concat #80143

Merged
merged 1 commit into from Mar 7, 2023

Conversation

mkrizek
Copy link
Contributor

@mkrizek mkrizek commented Mar 6, 2023

SUMMARY

The wrap_var is done in do_template for all concat functions after their return.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

lib/ansible/template/native_helpers.py

The wrap_var is done in do_template for all concat functions after their
return.
@ansibot ansibot added WIP This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers. affects_2.15 bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. labels Mar 6, 2023
@mkrizek mkrizek requested a review from sivel March 6, 2023 15:35
@mkrizek mkrizek marked this pull request as ready for review March 6, 2023 15:35
@ansibot ansibot removed the WIP This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers. label Mar 6, 2023
@sivel
Copy link
Member

sivel commented Mar 6, 2023

Just to clarify, this is redundant because of the following code correct?

res = self.environment.concat(rf)
unsafe = getattr(self.cur_context, 'unsafe', False)
if unsafe:
res = wrap_var(res)

@mkrizek
Copy link
Contributor Author

mkrizek commented Mar 6, 2023

Just to clarify, this is redundant because of the following code correct?

res = self.environment.concat(rf)
unsafe = getattr(self.cur_context, 'unsafe', False)
if unsafe:
res = wrap_var(res)

Correct.

@mkrizek mkrizek removed the needs_triage Needs a first human triage before being processed. label Mar 7, 2023
@mkrizek mkrizek merged commit 694f12d into ansible:devel Mar 7, 2023
@mkrizek mkrizek deleted the redundant-unsafe-concat branch March 7, 2023 15:14
mkrizek added a commit to mkrizek/ansible that referenced this pull request Mar 8, 2023
The wrap_var is done in do_template for all concat functions after their
return.

(cherry picked from commit 694f12d)
@ansible ansible locked and limited conversation to collaborators Mar 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.15 bug This issue/PR relates to a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants