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:
Marga Millet 2016-01-17 14:13:03 -08:00
parent 502d44b062
commit 446f4ca18d

View File

@ -14,12 +14,12 @@
# limitations under the License.
import logging
import urllib
import fixtures
import mock
from oslo_utils import timeutils
import routes
from six.moves import urllib
import webob
from murano.api.v1 import request_statistics
@ -164,7 +164,7 @@ class ControllerTest(object):
environ['REQUEST_METHOD'] = method
if params:
qs = urllib.urlencode(params)
qs = urllib.parse.urlencode(params)
environ['QUERY_STRING'] = qs
req = wsgi.Request(environ)
@ -209,7 +209,7 @@ class ControllerTest(object):
req.body = data
if params:
qs = urllib.urlencode(params)
qs = urllib.parse.urlencode(params)
environ['QUERY_STRING'] = qs
return req