diff --git a/openstack_dashboard/dashboards/identity/projects/tests.py b/openstack_dashboard/dashboards/identity/projects/tests.py index d6eb908142..6d79681159 100644 --- a/openstack_dashboard/dashboards/identity/projects/tests.py +++ b/openstack_dashboard/dashboards/identity/projects/tests.py @@ -548,7 +548,7 @@ class CreateProjectWorkflowTests(test.BaseAdminViewTests): url = reverse('horizon:identity:projects:create') res = self.client.post(url, workflow_data) msg = 'Quota value(s) cannot be less than the current usage ' \ - 'value(s): 5 instances used.' + 'value(s): 5 Instances used.' self.assertContains(res, msg) @test.create_stubs({api.keystone: ('tenant_create', diff --git a/openstack_dashboard/dashboards/identity/projects/workflows.py b/openstack_dashboard/dashboards/identity/projects/workflows.py index ff9af0bcc3..5d75bb1658 100644 --- a/openstack_dashboard/dashboards/identity/projects/workflows.py +++ b/openstack_dashboard/dashboards/identity/projects/workflows.py @@ -98,7 +98,7 @@ class UpdateProjectQuotaAction(workflows.Action): if value is not None and value >= 0 and used > value: bad_values.append(_('%(used)s %(key)s used') % {'used': used, - 'key': key}) + 'key': quotas.QUOTA_NAMES.get(key, key)}) if bad_values: value_str = ", ".join(bad_values) msg = (_('Quota value(s) cannot be less than the current usage ' diff --git a/openstack_dashboard/usage/quotas.py b/openstack_dashboard/usage/quotas.py index 25b3b2323b..9bd67807c1 100644 --- a/openstack_dashboard/usage/quotas.py +++ b/openstack_dashboard/usage/quotas.py @@ -58,6 +58,31 @@ NEUTRON_QUOTA_FIELDS = ("network", QUOTA_FIELDS = NOVA_QUOTA_FIELDS + CINDER_QUOTA_FIELDS + NEUTRON_QUOTA_FIELDS +QUOTA_NAMES = { + "metadata_items": _('Metadata Items'), + "cores": _('VCPUs'), + "instances": _('Instances'), + "injected_files": _('Injected Files'), + "injected_file_content_bytes": _('Injected File Content Bytes'), + "ram": _('RAM (MB)'), + "floating_ips": _('Floating IPs'), + "fixed_ips": _('Fixed IPs'), + "security_groups": _('Security Groups'), + "security_group_rules": _('Security Group Rules'), + "key_pairs": _('Key Pairs'), + "injected_file_path_bytes": _('Injected File Path Bytes'), + "volumes": _('Volumes'), + "snapshots": _('Volume Snapshots'), + "gigabytes": _('Total Size of Volumes and Snapshots (GB)'), + "network": _("Networks"), + "subnet": _("Subnets"), + "port": _("Ports"), + "router": _("Routers"), + "floatingip": _('Floating IPs'), + "security_group": _("Security Groups"), + "security_group_rule": _("Security Group Rules") +} + class QuotaUsage(dict): """Tracks quota limit, used, and available for a given set of quotas."""