volume.volumeId property used wrongly as .volume_id
Fixes bug 969162 Also, the created_at property was used as createdAt, which lead to object reloading during template render due to missing prop. See bug desc for more details. Also, in the volume details template, the url link for instance details was wrong - it was the link for volume details instead. Fixes Bug 971150 Change-Id: If5cfd515d0726a9ab85021b904a53e94b80205ea
This commit is contained in:
parent
e04580f4d3
commit
e1f7473723
|
@ -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:
|
||||
|
|
|
@ -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, "<dd>Volume name</dd>", 1, 200)
|
||||
self.assertContains(res, "<dd>1</dd>", 1, 200)
|
||||
self.assertContains(res, "<dd>Available</dd>", 1, 200)
|
||||
self.assertContains(res, "<dd>40 GB</dd>", 1, 200)
|
||||
self.assertContains(res, "<dd>04/01/12 at 10:30:00</dd>", 1, 200)
|
||||
self.assertContains(res, "<a href=\"/nova/instances_and_volumes/"
|
||||
"instances/1/detail\">Instance server_1 "
|
||||
"(1)</a>", 1, 200)
|
||||
|
||||
self.assertNoMessages()
|
||||
|
|
|
@ -82,8 +82,8 @@
|
|||
{% for volume in instance.volumes %}
|
||||
<dt>{% trans "Volume" %}</dt>
|
||||
<dd>
|
||||
<a href="{% url horizon:nova:instances_and_volumes:volumes:detail volume.volume_id %}">
|
||||
{{ volume.volume_id }} ({{ volume.device }})
|
||||
<a href="{% url horizon:nova:instances_and_volumes:volumes:detail volume.volumeId %}">
|
||||
{{ volume.volumeId }} ({{ volume.device }})
|
||||
</a>
|
||||
</dd>
|
||||
{% endfor %}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<dt>{% trans "Name" %}</dt>
|
||||
<dd>{{ volume.display_name }}</dd>
|
||||
<dt>{% trans "ID" %}</dt>
|
||||
<dd>{{ volume.id }}</d>
|
||||
<dd>{{ volume.id }}</dd>
|
||||
{% if volume.display_description %}
|
||||
<dt>{% trans "Description" %}</dt>
|
||||
<dd>{{ volume.display_description }}</dd>
|
||||
|
@ -26,7 +26,7 @@
|
|||
<dt>{% trans "Size" %}</dt>
|
||||
<dd>{{ volume.size }} {% trans "GB" %}</dd>
|
||||
<dt>{% trans "Created" %}</dt>
|
||||
<dd>{{ volume.createdAt|parse_date }}</dd>
|
||||
<dd>{{ volume.created_at|parse_date }}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
@ -37,9 +37,9 @@
|
|||
<dl>
|
||||
<dt>{% trans "Attached To" %}<dt>
|
||||
<dd>
|
||||
{% url horizon:nova:instances_and_volumes:volumes:detail attachment.server_id as instance_url%}
|
||||
<a href="{{ instance_url }}">{% trans "Instance" %} {{ attachment.instance.id }} ({{ attachment.instance.name }})</a>
|
||||
<span>{% trans "on" %} {{ attachment.device }}</span>
|
||||
{% url horizon:nova:instances_and_volumes:instances:detail attachment.server_id as instance_url%}
|
||||
<a href="{{ instance_url }}">{% trans "Instance" %} {{ attachment.instance.name }} ({{ attachment.instance.id }})</a>
|
||||
<span> {% trans "on" %} {{ attachment.device }}</span>
|
||||
</dd>
|
||||
</dl>
|
||||
{% empty %}
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue