1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Use the six import for urlsplit instead of importing directly. (#3902)

Fixes https://github.com/ansible/ansible/issues/16191
This commit is contained in:
jctanner 2016-06-09 13:25:17 -04:00 committed by Matt Clay
parent 513c3bf287
commit 48f096b52c

View file

@ -182,13 +182,13 @@ EXAMPLES='''
get_url: url="file:///tmp/afile.txt" dest=/tmp/afilecopy.txt
'''
import urlparse
from ansible.module_utils.six.moves.urllib.parse import urlsplit
# ==============================================================
# url handling
def url_filename(url):
fn = os.path.basename(urlparse.urlsplit(url)[2])
fn = os.path.basename(urlsplit(url)[2])
if fn == '':
return 'index.html'
return fn