Added urlquote call around keypair name in delete form. Fixed bug 898803.

Change-Id: Ie39c0c9136a2b02247a4e67a16d91ef09c2e5ddc
This commit is contained in:
Gabriel Hurley 2011-12-01 12:59:31 -08:00
parent 058c2847bb
commit eb89672500
1 changed files with 2 additions and 1 deletions

View File

@ -24,6 +24,7 @@ from django import http
from django import shortcuts
from django.contrib import messages
from django.core import validators
from django.utils.http import urlquote
from django.utils.translation import ugettext as _
from novaclient import exceptions as novaclient_exceptions
@ -40,7 +41,7 @@ class DeleteKeypair(forms.SelfHandlingForm):
def handle(self, request, data):
try:
LOG.info('Deleting keypair "%s"' % data['keypair_id'])
api.keypair_delete(request, data['keypair_id'])
api.keypair_delete(request, urlquote(data['keypair_id']))
messages.info(request, _('Successfully deleted keypair: %s')
% data['keypair_id'])
except novaclient_exceptions.ClientException, e: