redhat-cop / openshift-applier

Used to apply OpenShift objects to an OpenShift Cluster
Apache License 2.0
102 stars 61 forks source link

Import 'urlparse' module fails with ansible and Python3 #81

Closed mpreu closed 5 years ago

mpreu commented 5 years ago

Fedora 29 distributes ansible packages in versions 2.7.1 and 2.6.5, all of them executing Python3 by default. This leads to the following error when using the applier:

[WARNING]: Skipping plugin (.../.openshift-applier/roles/openshift-applier/roles/openshift-applier/filter_plugins/applier-filters.py) as it seems to be invalid: No module named 'urlparse'

As the module name changed between Python2 and Python3 (urlparse -> urllib.parse) a suggestion for a fix to support Python3 interpreters could be:

try:
    from urlparse import urljoin
except ImportError:
    from urllib.parse import urljoin
tylerauerbeck commented 5 years ago

Resolved by #82