Be sure to import urllib.parse from somewhere

pull/18777/head
Toshio Kuratomi 9 years ago committed by Matt Clay
parent fc486824b8
commit 8ba0af5df3

@ -30,6 +30,9 @@ try:
except ImportError:
import simplejson as json
import ansible.module_utils.six
DOCUMENTATION = '''
---
module: uri
@ -265,7 +268,7 @@ def write_file(module, url, dest, content):
def url_filename(url):
fn = os.path.basename(urlparse.urlsplit(url)[2])
fn = os.path.basename(six.moves.urllib.parse.urlsplit(url)[2])
if fn == '':
return 'index.html'
return fn
@ -280,7 +283,7 @@ def absolute_location(url, location):
return location
elif location.startswith('/'):
parts = urlparse.urlsplit(url)
parts = six.moves.urllib.parse.urlsplit(url)
base = url.replace(parts[2], '')
return '%s%s' % (base, location)

Loading…
Cancel
Save