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

Put a list between the two maps for Python 3 #1734

Closed
wants to merge 1 commit into from
Closed

Put a list between the two maps for Python 3 #1734

wants to merge 1 commit into from

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented Mar 19, 2019

As discussed at #1399 (comment) and #1674 (comment)

You could try putting | list | in between the two calls to map(). Python 3 often creates generators instead of lists so perhaps forcing the results of the first map() call into a list will placate Jinja2.

@rvagg
Copy link
Member

rvagg commented Mar 19, 2019

yeah, I tried it:

fatal: [test-requireio_kahwee-debian9-arm64_pi3-1]: FAILED! => {"msg": "Unexpected templating type error occurred on ({{ ccache_html_content.stdout | regex_findall('ccache-[0-9]+.[0-9]+(?:.[0-9]+)*.tar.gz') | map('regex_replace', 'ccache-') | list | map('regex_replace', '.tar.gz') | list | latest_version }}): '<' not supported between instances of 'map' and 'map'"}

tried adding another too:

fatal: [test-requireio_kahwee-debian9-arm64_pi3-1]: FAILED! => {"msg": "Unexpected templating type error occurred on ({{ ccache_html_content.stdout | regex_findall('ccache-[0-9]+.[0-9]+(?:.[0-9]+)*.tar.gz') | list | map('regex_replace', 'ccache-') | list | map('regex_replace', '.tar.gz') | list | latest_version }}): '<' not supported between instances of 'map' and 'map'"}

btw I'm getting this from roles/jenkins-worker/tasks/partials/docker-host.yml where it's repeated.

@cclauss
Copy link
Contributor Author

cclauss commented Mar 19, 2019

Closing because (of course) @refack was correct when he wrote:

I'll try to move that super-filter out of the template and into code

@cclauss cclauss closed this Mar 19, 2019
@cclauss cclauss deleted the patch-3 branch March 19, 2019 09:32
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.

2 participants