mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Fixed import of urlencode and pathname2url from urllib for python3 (#24424)
This commit is contained in:
@@ -225,9 +225,9 @@ from datetime import datetime, timedelta
|
||||
import json
|
||||
import os
|
||||
from time import sleep
|
||||
from urllib import urlencode
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.six.moves.urllib.parse import urlencode
|
||||
from ansible.module_utils.urls import fetch_url
|
||||
|
||||
API_URL = 'https://api.cloudscale.ch/v1/'
|
||||
|
||||
@@ -96,13 +96,13 @@ EXAMPLES = '''
|
||||
'''
|
||||
|
||||
import atexit
|
||||
import urllib
|
||||
import mmap
|
||||
import errno
|
||||
import socket
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.pycompat24 import get_exception
|
||||
from ansible.module_utils.six.moves.urllib.parse import urlencode
|
||||
from ansible.module_utils.urls import open_url
|
||||
|
||||
def vmware_path(datastore, datacenter, path):
|
||||
@@ -116,7 +116,7 @@ def vmware_path(datastore, datacenter, path):
|
||||
params = dict( dsName = datastore )
|
||||
if datacenter:
|
||||
params["dcPath"] = datacenter
|
||||
params = urllib.urlencode(params)
|
||||
params = urlencode(params)
|
||||
return "%s?%s" % (path, params)
|
||||
|
||||
def main():
|
||||
|
||||
Reference in New Issue
Block a user