Python3: Keep compatibility for urllib.urlencode
In Python3, urlencode is not ins urllib module as it used to be in Python2.7. To keep compatibility, use urllib.parse.urlencode instead of urllib.urlencode. Targets blueprint: murano-python-3-support Change-Id: I6c04049636bd1e853b87cd6913ac6adf002aa76f
This commit is contained in:
parent
502d44b062
commit
446f4ca18d
@ -14,12 +14,12 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import urllib
|
|
||||||
|
|
||||||
import fixtures
|
import fixtures
|
||||||
import mock
|
import mock
|
||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
import routes
|
import routes
|
||||||
|
from six.moves import urllib
|
||||||
import webob
|
import webob
|
||||||
|
|
||||||
from murano.api.v1 import request_statistics
|
from murano.api.v1 import request_statistics
|
||||||
@ -164,7 +164,7 @@ class ControllerTest(object):
|
|||||||
environ['REQUEST_METHOD'] = method
|
environ['REQUEST_METHOD'] = method
|
||||||
|
|
||||||
if params:
|
if params:
|
||||||
qs = urllib.urlencode(params)
|
qs = urllib.parse.urlencode(params)
|
||||||
environ['QUERY_STRING'] = qs
|
environ['QUERY_STRING'] = qs
|
||||||
|
|
||||||
req = wsgi.Request(environ)
|
req = wsgi.Request(environ)
|
||||||
@ -209,7 +209,7 @@ class ControllerTest(object):
|
|||||||
req.body = data
|
req.body = data
|
||||||
|
|
||||||
if params:
|
if params:
|
||||||
qs = urllib.urlencode(params)
|
qs = urllib.parse.urlencode(params)
|
||||||
environ['QUERY_STRING'] = qs
|
environ['QUERY_STRING'] = qs
|
||||||
|
|
||||||
return req
|
return req
|
||||||
|
Loading…
x
Reference in New Issue
Block a user