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

Python 3 fix for reading container elements from job_conf. #5427

Merged
merged 1 commit into from
Feb 1, 2018

Conversation

jmchilton
Copy link
Member

@jmchilton jmchilton commented Jan 31, 2018

xref. #1715

@@ -422,8 +422,10 @@ def __get_params(self, parent):
key = param.get('id')
if key in ["container", "container_override"]:
from galaxy.tools.deps import requirements
# Get container elements contained within the param.
# https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.ElementTree.Element.getchildren
containers = map(requirements.container_from_element, list(param))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you s|list(param)|param.findall('container')| instead? It's more specific and seems to work for me.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is much better - thanks!

- Python 3 fix to martialize iterator into list.
- Restrict XML query to just container elements - this is much more correct.

Both fixes thanks to @nsoranzo.
@nsoranzo nsoranzo merged commit 9489fe4 into galaxyproject:dev Feb 1, 2018
@nsoranzo
Copy link
Member

nsoranzo commented Feb 1, 2018

Thanks a lot @jmchilton!

@nsoranzo nsoranzo added the area/python3 Specific to Python 3 label Jul 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants