Delete periods from select options

Make the UI more consistent by deleting periods which appear
intermittently at the end of some select options.

Closes-Bug: #1263823
Change-Id: I6f184b205788171fd4931f5a622353d943161123
This commit is contained in:
Ana Krivokapic 2013-12-24 05:36:28 +01:00
parent 58feb1a0fd
commit 66ae9cc886
9 changed files with 22 additions and 22 deletions

View File

@ -68,5 +68,5 @@ class AllocateView(forms.ModalFormView):
_("Unable to retrieve floating IP pools."))
pool_list = [(pool.id, pool.name) for pool in pools]
if not pool_list:
pool_list = [(None, _("No floating IP pools available."))]
pool_list = [(None, _("No floating IP pools available"))]
return {'pool_list': pool_list}

View File

@ -60,7 +60,7 @@ class RebuildInstanceForm(forms.SelfHandlingForm):
if choices:
choices.insert(0, ("", _("Select Image")))
else:
choices.insert(0, ("", _("No images available.")))
choices.insert(0, ("", _("No images available")))
self.fields['image'].choices = choices
if not api.nova.can_set_server_password():

View File

@ -1028,7 +1028,7 @@ class InstanceTests(test.TestCase):
else:
self.assertNotContains(res, password_field_label)
boot_from_image_field_label = 'Boot from image (creates a new volume).'
boot_from_image_field_label = 'Boot from image (creates a new volume)'
if block_device_mapping_v2:
self.assertContains(res, boot_from_image_field_label)
else:

View File

@ -135,22 +135,22 @@ class SetInstanceDetailsAction(workflows.Action):
request, context, *args, **kwargs)
source_type_choices = [
('', _("--- Select source ---")),
("image_id", _("Boot from image.")),
("instance_snapshot_id", _("Boot from snapshot.")),
("volume_id", _("Boot from volume.")),
("image_id", _("Boot from image")),
("instance_snapshot_id", _("Boot from snapshot")),
("volume_id", _("Boot from volume")),
]
try:
if api.nova.extension_supported("BlockDeviceMappingV2Boot",
request):
source_type_choices.append(("volume_image_id",
_("Boot from image (creates a new volume).")))
_("Boot from image (creates a new volume)")))
except Exception:
exceptions.handle(request, _('Unable to retrieve extensions '
'information.'))
source_type_choices.append(("volume_snapshot_id",
_("Boot from volume snapshot (creates a new volume).")))
_("Boot from volume snapshot (creates a new volume)")))
self.fields['source_type'].choices = source_type_choices
def clean(self):
@ -252,7 +252,7 @@ class SetInstanceDetailsAction(workflows.Action):
for zone in zones if zone.zoneState['available']]
zone_list.sort()
if not zone_list:
zone_list.insert(0, ("", _("No availability zones found.")))
zone_list.insert(0, ("", _("No availability zones found")))
elif len(zone_list) > 1:
zone_list.insert(0, ("", _("Any Availability Zone")))
return zone_list
@ -323,7 +323,7 @@ class SetInstanceDetailsAction(workflows.Action):
if choices:
choices.insert(0, ("", _("Select Instance Snapshot")))
else:
choices.insert(0, ("", _("No snapshots available.")))
choices.insert(0, ("", _("No snapshots available")))
return choices
def populate_volume_id_choices(self, request, context):
@ -338,7 +338,7 @@ class SetInstanceDetailsAction(workflows.Action):
if volumes:
volumes.insert(0, ("", _("Select Volume")))
else:
volumes.insert(0, ("", _("No volumes available.")))
volumes.insert(0, ("", _("No volumes available")))
return volumes
def populate_volume_snapshot_id_choices(self, request, context):
@ -354,7 +354,7 @@ class SetInstanceDetailsAction(workflows.Action):
if snapshots:
snapshots.insert(0, ("", _("Select Volume Snapshot")))
else:
snapshots.insert(0, ("", _("No volume snapshots available.")))
snapshots.insert(0, ("", _("No volume snapshots available")))
return snapshots
@ -441,7 +441,7 @@ class SetAccessControlsAction(workflows.Action):
self.fields['keypair'].initial = keypair_list[0][0]
keypair_list.insert(0, ("", _("Select a keypair")))
else:
keypair_list = (("", _("No keypairs available.")),)
keypair_list = (("", _("No keypairs available")),)
return keypair_list
def populate_groups_choices(self, request, context):

View File

@ -60,7 +60,7 @@ class SetFlavorChoiceAction(workflows.Action):
if flavor_list:
flavor_list.insert(0, ("", _("Select an New Flavor")))
else:
flavor_list.insert(0, ("", _("No flavors available.")))
flavor_list.insert(0, ("", _("No flavors available")))
return sorted(flavor_list)
def get_help_text(self):

View File

@ -287,10 +287,10 @@ class LoadBalancerTests(test.TestCase):
if not with_service_type:
self.assertNotContains(res, default_provider)
self.assertContains(res, ('Provider for Load Balancer '
'is not supported.'))
'is not supported'))
elif with_provider_exception:
self.assertNotContains(res, default_provider)
self.assertContains(res, 'No provider is available.')
self.assertContains(res, 'No provider is available')
else:
self.assertContains(res, default_provider)

View File

@ -95,9 +95,9 @@ class AddPoolAction(workflows.Action):
_("%s (default)") % default_provider))
else:
if providers is None:
msg = _("Provider for Load Balancer is not supported.")
msg = _("Provider for Load Balancer is not supported")
else:
msg = _("No provider is available.")
msg = _("No provider is available")
provider_choices = [('', msg)]
self.fields['provider'].widget.attrs['readonly'] = True
self.fields['provider'].choices = provider_choices

View File

@ -72,7 +72,7 @@ class AddInterface(forms.SelfHandlingForm):
if choices:
choices.insert(0, ("", _("Select Subnet")))
else:
choices.insert(0, ("", _("No subnets available.")))
choices.insert(0, ("", _("No subnets available")))
return choices
def handle(self, request, data):
@ -172,7 +172,7 @@ class SetGatewayForm(forms.SelfHandlingForm):
if choices:
choices.insert(0, ("", _("Select network")))
else:
choices.insert(0, ("", _("No networks available.")))
choices.insert(0, ("", _("No networks available")))
return choices
def handle(self, request, data):

View File

@ -170,7 +170,7 @@ class CreateForm(forms.SelfHandlingForm):
if source_type_choices:
choices = ([('no_source_type',
_("No source, empty volume."))] +
_("No source, empty volume"))] +
source_type_choices)
self.fields['volume_source_type'].choices = choices
else:
@ -198,7 +198,7 @@ class CreateForm(forms.SelfHandlingForm):
exceptions.handle(request, _('Unable to retrieve availability '
'zones.'))
if not zone_list:
zone_list.insert(0, ("", _("No availability zones found.")))
zone_list.insert(0, ("", _("No availability zones found")))
elif len(zone_list) > 0:
zone_list.insert(0, ("", _("Any Availability Zone")))