From 4475225cbe373c50e5be4098aba8dbcdccf93fd9 Mon Sep 17 00:00:00 2001 From: lin-hua-cheng Date: Mon, 16 Mar 2015 09:56:34 -0700 Subject: [PATCH] Replace usage of urllib in nova rest api urllib is incompatible for python 3. Change-Id: I3d70cd3f77a946afd4e873823edfdc5bd0e07a16 --- openstack_dashboard/api/rest/nova.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/openstack_dashboard/api/rest/nova.py b/openstack_dashboard/api/rest/nova.py index 4e2f2ad4cd..19fb25d873 100644 --- a/openstack_dashboard/api/rest/nova.py +++ b/openstack_dashboard/api/rest/nova.py @@ -15,8 +15,7 @@ """API over the nova service. """ -import urllib - +from django.utils import http as utils_http from django.views import generic from openstack_dashboard import api @@ -58,7 +57,7 @@ class Keypairs(generic.View): else: new = api.nova.keypair_create(request, request.DATA['name']) return rest_utils.CreatedResponse( - '/api/nova/keypairs/%s' % urllib.quote(new.name), + '/api/nova/keypairs/%s' % utils_http.urlquote(new.name), new.to_dict() ) @@ -170,7 +169,7 @@ class Servers(generic.View): new = api.nova.server_create(*args, **kw) return rest_utils.CreatedResponse( - '/api/nova/servers/%s' % urllib.quote(new.id), + '/api/nova/servers/%s' % utils_http.urlquote(new.id), new.to_dict() )