diff --git a/horizon/templates/horizon/common/_quota_summary.html b/horizon/templates/horizon/common/_quota_summary.html
index 7ebbbc51d1..026af423ff 100644
--- a/horizon/templates/horizon/common/_quota_summary.html
+++ b/horizon/templates/horizon/common/_quota_summary.html
@@ -30,6 +30,12 @@
{% blocktrans with used=usage.quotas.volumes.used|intcomma available=usage.quotas.volumes.quota|intcomma %} Used {{ used }} of {{ available }} {% endblocktrans %}
+
+
+ {% trans "Available Snapshots" %}
+ {% blocktrans with used=usage.quotas.snapshots.used|intcomma available=usage.quotas.snapshots.quota|intcomma %} Used {{ used }} of {{ available }} {% endblocktrans %}
+
+
{% trans "Available Volume Storage" %}
diff --git a/openstack_dashboard/dashboards/admin/info/tests.py b/openstack_dashboard/dashboards/admin/info/tests.py
index 9bb88fdf30..162268c8cd 100644
--- a/openstack_dashboard/dashboards/admin/info/tests.py
+++ b/openstack_dashboard/dashboards/admin/info/tests.py
@@ -31,7 +31,7 @@ class ServicesViewTests(test.BaseAdminViewTests):
api.nova.default_quota_get(IsA(http.HttpRequest),
self.tenant.id).AndReturn(self.quotas.nova)
api.cinder.default_quota_get(IsA(http.HttpRequest), self.tenant.id) \
- .AndReturn(self.quotas.nova)
+ .AndReturn(self.cinder_quotas.first())
self.mox.ReplayAll()
@@ -59,6 +59,7 @@ class ServicesViewTests(test.BaseAdminViewTests):
'',
'',
'',
+ '',
'',
'',
'',
diff --git a/openstack_dashboard/dashboards/admin/projects/tests.py b/openstack_dashboard/dashboards/admin/projects/tests.py
index a8ec8cab17..5baf03d442 100644
--- a/openstack_dashboard/dashboards/admin/projects/tests.py
+++ b/openstack_dashboard/dashboards/admin/projects/tests.py
@@ -58,9 +58,12 @@ class CreateProjectWorkflowTests(test.BaseAdminViewTests):
return project_info
def _get_quota_info(self, quota):
+ cinder_quota = self.cinder_quotas.first()
quota_data = {}
- for field in quotas.QUOTA_FIELDS:
+ for field in quotas.NOVA_QUOTA_FIELDS:
quota_data[field] = int(quota.get(field).limit)
+ for field in quotas.CINDER_QUOTA_FIELDS:
+ quota_data[field] = int(cinder_quota.get(field).limit)
return quota_data
def _get_workflow_data(self, project, quota):
@@ -403,9 +406,12 @@ class CreateProjectWorkflowTests(test.BaseAdminViewTests):
class UpdateProjectWorkflowTests(test.BaseAdminViewTests):
def _get_quota_info(self, quota):
+ cinder_quota = self.cinder_quotas.first()
quota_data = {}
- for field in quotas.QUOTA_FIELDS:
+ for field in quotas.NOVA_QUOTA_FIELDS:
quota_data[field] = int(quota.get(field).limit)
+ for field in quotas.CINDER_QUOTA_FIELDS:
+ quota_data[field] = int(cinder_quota.get(field).limit)
return quota_data
@test.create_stubs({api.keystone: ('get_default_role',
diff --git a/openstack_dashboard/dashboards/admin/projects/workflows.py b/openstack_dashboard/dashboards/admin/projects/workflows.py
index 2337da57c6..b9b39812c0 100644
--- a/openstack_dashboard/dashboards/admin/projects/workflows.py
+++ b/openstack_dashboard/dashboards/admin/projects/workflows.py
@@ -51,6 +51,7 @@ class UpdateProjectQuotaAction(workflows.Action):
injected_file_content_bytes = forms.IntegerField(min_value=-1,
label=ifcb_label)
volumes = forms.IntegerField(min_value=-1, label=_("Volumes"))
+ snapshots = forms.IntegerField(min_value=-1, label=_("Snapshots"))
gigabytes = forms.IntegerField(min_value=-1, label=_("Gigabytes"))
ram = forms.IntegerField(min_value=-1, label=_("RAM (MB)"))
floating_ips = forms.IntegerField(min_value=-1, label=_("Floating IPs"))
diff --git a/openstack_dashboard/dashboards/project/images_and_snapshots/volume_snapshots/tests.py b/openstack_dashboard/dashboards/project/images_and_snapshots/volume_snapshots/tests.py
index 27800b43d8..16e4d4e204 100644
--- a/openstack_dashboard/dashboards/project/images_and_snapshots/volume_snapshots/tests.py
+++ b/openstack_dashboard/dashboards/project/images_and_snapshots/volume_snapshots/tests.py
@@ -25,14 +25,21 @@ from mox import IsA
from openstack_dashboard import api
from openstack_dashboard.api import cinder
from openstack_dashboard.test import helpers as test
+from openstack_dashboard.usage import quotas
INDEX_URL = reverse('horizon:project:images_and_snapshots:index')
class VolumeSnapshotsViewTests(test.TestCase):
+ @test.create_stubs({quotas: ('tenant_quota_usages',)})
def test_create_snapshot_get(self):
volume = self.volumes.first()
+ usage = {'gigabytes': {'available': 250},
+ 'snapshots': {'available': 6}}
+ quotas.tenant_quota_usages(IsA(http.HttpRequest)).AndReturn(usage)
+ self.mox.ReplayAll()
+
url = reverse('horizon:project:volumes:create_snapshot',
args=[volume.id])
res = self.client.get(url)
diff --git a/openstack_dashboard/dashboards/project/volumes/templates/volumes/_create.html b/openstack_dashboard/dashboards/project/volumes/templates/volumes/_create.html
index fc64394bdc..b4670e6ba1 100644
--- a/openstack_dashboard/dashboards/project/volumes/templates/volumes/_create.html
+++ b/openstack_dashboard/dashboards/project/volumes/templates/volumes/_create.html
@@ -1,5 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
-{% load i18n horizon humanize %}
+{% load i18n %}
{% load url from future %}
{% block form_id %}{% endblock %}
@@ -16,38 +16,8 @@
-
{% trans "Description" %}:
-
-
{% trans "Volumes are block devices that can be attached to instances." %}
-
-
{% trans "Volume Quotas" %}
-
-
- {% trans "Total Gigabytes" %} ({{ usages.gigabytes.used|intcomma }} {% trans "GB" %})
-