diff options
author | Michael <michael-k@users.noreply.github.com> | 2017-05-19 19:22:16 +0200 |
---|---|---|
committer | Matt Martz <matt@sivel.net> | 2017-05-19 19:22:16 +0200 |
commit | b65ebf3519bb486c3de6a452cfe6f4aaa9a768f9 (patch) | |
tree | 7da2294ecb2289b3e27a13cab2041b03fa31c5d0 /contrib | |
parent | Fixed wrong variable in cumulus network module (#23950) (diff) | |
download | ansible-b65ebf3519bb486c3de6a452cfe6f4aaa9a768f9.tar.xz ansible-b65ebf3519bb486c3de6a452cfe6f4aaa9a768f9.zip |
Fixed import of urlencode and pathname2url from urllib for python3 (#24424)
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/inventory/collins.py | 4 | ||||
-rwxr-xr-x | contrib/inventory/proxmox.py | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/contrib/inventory/collins.py b/contrib/inventory/collins.py index 92e96187dc..d7d8bc4f35 100755 --- a/contrib/inventory/collins.py +++ b/contrib/inventory/collins.py @@ -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, diff --git a/contrib/inventory/proxmox.py b/contrib/inventory/proxmox.py index 90c5999217..97240f48c1 100755 --- a/contrib/inventory/proxmox.py +++ b/contrib/inventory/proxmox.py @@ -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, }) |