mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00: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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user