mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-23 12:33:59 -07:00
Fixed import of urlencode and pathname2url from urllib for python3 (#24424)
This commit is contained in:
parent
98a8b967d2
commit
b65ebf3519
26 changed files with 66 additions and 69 deletions
|
|
@ -74,7 +74,6 @@ import re
|
|||
import sys
|
||||
from time import time
|
||||
import traceback
|
||||
import urllib
|
||||
|
||||
try:
|
||||
import json
|
||||
|
|
@ -82,6 +81,7 @@ except ImportError:
|
|||
import simplejson as json
|
||||
|
||||
from six import iteritems
|
||||
from six.moves.urllib.parse import urlencode
|
||||
|
||||
from ansible.module_utils.urls import open_url
|
||||
|
||||
|
|
@ -194,7 +194,7 @@ class CollinsInventory(object):
|
|||
query_parameters['page'] = cur_page
|
||||
query_url = "%s?%s" % (
|
||||
(CollinsDefaults.ASSETS_API_ENDPOINT % self.collins_host),
|
||||
urllib.urlencode(query_parameters, doseq=True)
|
||||
urlencode(query_parameters, doseq=True)
|
||||
)
|
||||
try:
|
||||
response = open_url(query_url,
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@
|
|||
#
|
||||
# { "groups": ["utility", "databases"], "a": false, "b": true }
|
||||
|
||||
import urllib
|
||||
try:
|
||||
import json
|
||||
except ImportError:
|
||||
|
|
@ -35,6 +34,7 @@ import sys
|
|||
from optparse import OptionParser
|
||||
|
||||
from six import iteritems
|
||||
from six.moves.urllib.parse import urlencode
|
||||
|
||||
from ansible.module_utils.urls import open_url
|
||||
|
||||
|
|
@ -97,7 +97,7 @@ class ProxmoxAPI(object):
|
|||
def auth(self):
|
||||
request_path = '{}api2/json/access/ticket'.format(self.options.url)
|
||||
|
||||
request_params = urllib.urlencode({
|
||||
request_params = urlencode({
|
||||
'username': self.options.username,
|
||||
'password': self.options.password,
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue