mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
Fixed import of urlencode and pathname2url from urllib for python3 (#24424)
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user