Consolidate user visible spelling of keypair vs Key Pair

"Key Pair" wins the Google popularity contest (880k vs 300k),
and "Keypair" is not listed in Webster. Ispell autocorrects
it to "Key Pair" (or Key-Pair)

Change-Id: I4710b194dfd3c53f21fc99ce53db94cc5af0c158
Related-Bug: #1210533
This commit is contained in:
Dirk Mueller
2014-01-08 16:48:07 +01:00
parent e47f21a57b
commit 234c49d88d
16 changed files with 47 additions and 46 deletions

View File

@@ -31,14 +31,14 @@ from openstack_dashboard import api
NEW_LINES = re.compile(r"\r|\n")
KEYPAIR_ERROR_MESSAGES = {'invalid': _('Keypair names may '
KEYPAIR_ERROR_MESSAGES = {'invalid': _('Key pair names may '
'only contain letters, numbers, underscores '
'and hyphens.')}
class CreateKeypair(forms.SelfHandlingForm):
name = forms.CharField(max_length="255",
label=_("Keypair Name"),
label=_("Key Pair Name"),
validators=[validators.validate_slug],
error_messages=KEYPAIR_ERROR_MESSAGES)
@@ -47,7 +47,7 @@ class CreateKeypair(forms.SelfHandlingForm):
class ImportKeypair(forms.SelfHandlingForm):
name = forms.CharField(max_length="255", label=_("Keypair Name"),
name = forms.CharField(max_length="255", label=_("Key Pair Name"),
validators=[validators.validate_slug],
error_messages=KEYPAIR_ERROR_MESSAGES)
public_key = forms.CharField(label=_("Public Key"), widget=forms.Textarea)
@@ -64,5 +64,5 @@ class ImportKeypair(forms.SelfHandlingForm):
return keypair
except Exception:
exceptions.handle(request, ignore=True)
self.api_error(_('Unable to import keypair.'))
self.api_error(_('Unable to import key pair.'))
return False

View File

@@ -24,8 +24,8 @@ from openstack_dashboard.usage import quotas
class DeleteKeyPairs(tables.DeleteAction):
data_type_singular = _("Keypair")
data_type_plural = _("Keypairs")
data_type_singular = _("Key Pair")
data_type_plural = _("Key Pairs")
def delete(self, request, obj_id):
api.nova.keypair_delete(request, obj_id)
@@ -33,14 +33,14 @@ class DeleteKeyPairs(tables.DeleteAction):
class ImportKeyPair(tables.LinkAction):
name = "import"
verbose_name = _("Import Keypair")
verbose_name = _("Import Key Pair")
url = "horizon:project:access_and_security:keypairs:import"
classes = ("ajax-modal", "btn-upload")
class CreateKeyPair(tables.LinkAction):
name = "create"
verbose_name = _("Create Keypair")
verbose_name = _("Create Key Pair")
url = "horizon:project:access_and_security:keypairs:create"
classes = ("ajax-modal", "btn-create")
@@ -54,14 +54,14 @@ class CreateKeyPair(tables.LinkAction):
self.verbose_name = string_concat(self.verbose_name, ' ',
_("(Quota exceeded)"))
else:
self.verbose_name = _("Create Keypair")
self.verbose_name = _("Create Key Pair")
classes = [c for c in self.classes if c != "disabled"]
self.classes = classes
return True
class KeypairsTable(tables.DataTable):
name = tables.Column("name", verbose_name=_("Keypair Name"))
name = tables.Column("name", verbose_name=_("Key Pair Name"))
fingerprint = tables.Column("fingerprint", verbose_name=_("Fingerprint"))
def get_object_id(self, keypair):
@@ -69,6 +69,6 @@ class KeypairsTable(tables.DataTable):
class Meta:
name = "keypairs"
verbose_name = _("Keypairs")
verbose_name = _("Key Pairs")
table_actions = (CreateKeyPair, ImportKeyPair, DeleteKeyPairs,)
row_actions = (DeleteKeyPairs,)

View File

@@ -126,7 +126,7 @@ class KeyPairViewTests(test.TestCase):
url = reverse('horizon:project:access_and_security:keypairs:import')
res = self.client.post(url, formData, follow=True)
self.assertEqual(res.redirect_chain, [])
msg = 'Unable to import keypair.'
msg = 'Unable to import key pair.'
self.assertFormErrors(res, count=1, message=msg)
def test_import_keypair_invalid_key_name(self):

View File

@@ -70,7 +70,7 @@ class GenerateView(View):
except Exception:
redirect = reverse('horizon:project:access_and_security:index')
exceptions.handle(self.request,
_('Unable to create keypair: %(exc)s'),
_('Unable to create key pair: %(exc)s'),
redirect=redirect)
response = http.HttpResponse(mimetype='application/binary')