diff --git a/horizon/dashboards/nova/instances_and_volumes/instances/views.py b/horizon/dashboards/nova/instances_and_volumes/instances/views.py index e48b58591..79f74b6dc 100644 --- a/horizon/dashboards/nova/instances_and_volumes/instances/views.py +++ b/horizon/dashboards/nova/instances_and_volumes/instances/views.py @@ -103,12 +103,8 @@ class DetailView(tabs.TabView): instance = api.server_get(self.request, instance_id) instance.volumes = api.volume_instance_list(self.request, instance_id) - # Gather our flavors and images and correlate our instances to - # them. Exception handling happens in the parent class. - flavors = api.flavor_list(self.request) - full_flavors = SortedDict([(str(flavor.id), flavor) for \ - flavor in flavors]) - instance.full_flavor = full_flavors[instance.flavor["id"]] + instance.full_flavor = api.flavor_get(self.request, + instance.flavor["id"]) instance.security_groups = api.server_security_groups( self.request, instance_id) except: diff --git a/horizon/dashboards/nova/instances_and_volumes/volumes/tests.py b/horizon/dashboards/nova/instances_and_volumes/volumes/tests.py index b6bf901ec..9f4807cfe 100644 --- a/horizon/dashboards/nova/instances_and_volumes/volumes/tests.py +++ b/horizon/dashboards/nova/instances_and_volumes/volumes/tests.py @@ -59,5 +59,14 @@ class VolumeViewTests(test.TestCase): url = reverse('horizon:nova:instances_and_volumes:volumes:detail', args=[volume.id]) res = self.client.get(url) - self.assertEqual(res.status_code, 200) + + self.assertContains(res, "
Volume name
", 1, 200) + self.assertContains(res, "
1
", 1, 200) + self.assertContains(res, "
Available
", 1, 200) + self.assertContains(res, "
40 GB
", 1, 200) + self.assertContains(res, "
04/01/12 at 10:30:00
", 1, 200) + self.assertContains(res, "Instance server_1 " + "(1)", 1, 200) + self.assertNoMessages() diff --git a/horizon/dashboards/nova/templates/nova/instances_and_volumes/instances/_detail_overview.html b/horizon/dashboards/nova/templates/nova/instances_and_volumes/instances/_detail_overview.html index 759649f47..aacb429be 100644 --- a/horizon/dashboards/nova/templates/nova/instances_and_volumes/instances/_detail_overview.html +++ b/horizon/dashboards/nova/templates/nova/instances_and_volumes/instances/_detail_overview.html @@ -82,8 +82,8 @@ {% for volume in instance.volumes %}
{% trans "Volume" %}
- - {{ volume.volume_id }} ({{ volume.device }}) + + {{ volume.volumeId }} ({{ volume.device }})
{% endfor %} diff --git a/horizon/dashboards/nova/templates/nova/instances_and_volumes/volumes/_detail_overview.html b/horizon/dashboards/nova/templates/nova/instances_and_volumes/volumes/_detail_overview.html index b1adf6bab..c3d78db7f 100644 --- a/horizon/dashboards/nova/templates/nova/instances_and_volumes/volumes/_detail_overview.html +++ b/horizon/dashboards/nova/templates/nova/instances_and_volumes/volumes/_detail_overview.html @@ -9,7 +9,7 @@
{% trans "Name" %}
{{ volume.display_name }}
{% trans "ID" %}
-
{{ volume.id }} +
{{ volume.id }}
{% if volume.display_description %}
{% trans "Description" %}
{{ volume.display_description }}
@@ -26,7 +26,7 @@
{% trans "Size" %}
{{ volume.size }} {% trans "GB" %}
{% trans "Created" %}
-
{{ volume.createdAt|parse_date }}
+
{{ volume.created_at|parse_date }}
@@ -37,9 +37,9 @@
{% trans "Attached To" %}
- {% url horizon:nova:instances_and_volumes:volumes:detail attachment.server_id as instance_url%} - {% trans "Instance" %} {{ attachment.instance.id }} ({{ attachment.instance.name }}) - {% trans "on" %} {{ attachment.device }} + {% url horizon:nova:instances_and_volumes:instances:detail attachment.server_id as instance_url%} + {% trans "Instance" %} {{ attachment.instance.name }} ({{ attachment.instance.id }}) + {% trans "on" %} {{ attachment.device }}
{% empty %} diff --git a/horizon/tests/test_data/nova_data.py b/horizon/tests/test_data/nova_data.py index 2f9afc60b..dd6de1fe4 100644 --- a/horizon/tests/test_data/nova_data.py +++ b/horizon/tests/test_data/nova_data.py @@ -148,7 +148,8 @@ def data(TEST): name='test_volume', status='available', size=40, - display_name='', + display_name='Volume name', + created_at='2012-04-01 10:30:00', attachments={})) TEST.volumes.add(volume)