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
commit 48f096b52c

View file

@ -182,13 +182,13 @@ EXAMPLES='''
get_url: url="file:///tmp/afile.txt" dest=/tmp/afilecopy.txt 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 # url handling
def url_filename(url): def url_filename(url):
fn = os.path.basename(urlparse.urlsplit(url)[2]) fn = os.path.basename(urlsplit(url)[2])
if fn == '': if fn == '':
return 'index.html' return 'index.html'
return fn return fn