Merge "Added empty line in KeyPair fields."

This commit is contained in:
Jenkins 2014-01-22 09:22:19 +00:00 committed by Gerrit Code Review
commit 69372d0a14
1 changed files with 4 additions and 3 deletions

View File

@ -496,11 +496,12 @@ class FlavorChoiceField(ChoiceField):
class KeyPairChoiceField(ChoiceField):
" This widget allows to select Key Pair for VMs "
" This widget allows to select keypair for VMs "
@with_request
def update(self, request, **kwargs):
self.choices = [(keypair.name, keypair.name) for keypair in
novaclient(request).keypairs.list()]
self.choices = [('', _('No keypair'))]
for keypair in novaclient(request).keypairs.list():
self.choices.append((keypair.name, keypair.name))
class ImageChoiceField(ChoiceField):