Fixed import of urlencode and pathname2url from urllib for python3 (#24424)

This commit is contained in:
Michael 2017-05-19 17:22:16 +00:00 committed by Matt Martz
parent 98a8b967d2
commit b65ebf3519
26 changed files with 66 additions and 69 deletions

View file

@ -140,7 +140,7 @@ EXAMPLES = '''
# =======================================
# sendgrid module support methods
#
import urllib
from ansible.module_utils.six.moves.urllib.parse import urlencode
try:
import sendgrid
@ -157,7 +157,7 @@ def post_sendgrid_api(module, username, password, from_address, to_addresses,
AGENT = "Ansible"
data = {'api_user': username, 'api_key':password,
'from':from_address, 'subject': subject, 'text': body}
encoded_data = urllib.urlencode(data)
encoded_data = urlencode(data)
to_addresses_api = ''
for recipient in to_addresses:
if isinstance(recipient, unicode):