mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 04:11:25 -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
|
@ -20,7 +20,6 @@ from __future__ import (absolute_import, division, print_function)
|
|||
__metaclass__ = type
|
||||
|
||||
import os
|
||||
import urllib
|
||||
|
||||
try:
|
||||
import prettytable
|
||||
|
@ -29,6 +28,7 @@ except ImportError:
|
|||
HAS_PRETTYTABLE = False
|
||||
|
||||
from ansible.plugins.callback import CallbackBase
|
||||
from ansible.module_utils.six.moves.urllib.parse import urlencode
|
||||
from ansible.module_utils.urls import open_url
|
||||
|
||||
|
||||
|
@ -89,7 +89,7 @@ class CallbackModule(CallbackBase):
|
|||
|
||||
url = ('%s?auth_token=%s' % (self.msg_uri, self.token))
|
||||
try:
|
||||
response = open_url(url, data=urllib.urlencode(params))
|
||||
response = open_url(url, data=urlencode(params))
|
||||
return response.read()
|
||||
except:
|
||||
self._display.warning('Could not submit message to hipchat')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue