-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
plugins/tower.py: Use urllib.parse rather than urlparse #3416
plugins/tower.py: Use urllib.parse rather than urlparse #3416
Conversation
Build succeeded.
|
This is quite similar in nature to: We have not committed to supporting inventory updates via scripts in python3 virtual environments. This shouldn't be a formal test objective. We will absolutely support inventory updates via plugins in python3 virtual environments, including the default virtual environment. However, it remains extremely important that
At best, you could do a conditional import. I wouldn't object to that, but it would still be officially unsupported to run it in python3. |
I'm not against just saying this one only works in py2, personally (especially if Tower inv plugins are on by default after @AlanCoding's PR merges). |
awx/plugins/inventory/tower.py
Outdated
@@ -34,7 +34,7 @@ | |||
import json | |||
import requests | |||
from requests.auth import HTTPBasicAuth | |||
from urlparse import urljoin | |||
from urllib.parse import urljoin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we do this, we should at least make this 2/3 compatible:
try:
from urlparse import urljoin
except ImportError:
from urllib.parse import urljoin
We'll have either python2 or python3 for the ansible-inventory environment depending on OS; ergo, I would expect customer scripts to potentially be run in either depending on their deployment platform. |
urlparse does not exist in python3, it has been replaced by urllib.parse Signed-off-by: Yanis Guenane <yguenane@redhat.com>
Build succeeded.
|
Build succeeded (gate pipeline).
|
SUMMARY
urlparse
does not exist in python3, it has been replaced byurllib.parse
ISSUE TYPE
COMPONENT NAME
AWX VERSION
ADDITIONAL INFORMATION