mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07: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:
parent
513c3bf287
commit
48f096b52c
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue