Skip to content

Commit

Permalink
Merge "volume.volumeId property used wrongly as .volume_id"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Apr 2, 2012
2 parents 2883b6e + bb1e7e6 commit 47f4459
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 15 deletions.
Expand Up @@ -103,12 +103,8 @@ def get_data(self):
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:
Expand Down
11 changes: 10 additions & 1 deletion horizon/dashboards/nova/instances_and_volumes/volumes/tests.py
Expand Up @@ -59,5 +59,14 @@ def test_detail_view(self):
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()
Expand Up @@ -82,8 +82,8 @@ <h4>{% trans "Volumes" %}</h4>
{% 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 }}&nbsp;({{ volume.device }})
<a href="{% url horizon:nova:instances_and_volumes:volumes:detail volume.volumeId %}">
{{ volume.volumeId }}&nbsp;({{ volume.device }})
</a>
</dd>
{% endfor %}
Expand Down
Expand Up @@ -9,7 +9,7 @@ <h4>{% trans "Info" %}</h4>
<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>
Expand All @@ -26,7 +26,7 @@ <h4>{% trans "Specs" %}</h4>
<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>

Expand All @@ -37,9 +37,9 @@ <h4>{% trans "Attachments" %}</h4>
<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" %}&nbsp;{{ attachment.instance.id }} ({{ attachment.instance.name }})</a>
<span>{% trans "on" %}&nbsp;{{ 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 %}
Expand Down
3 changes: 2 additions & 1 deletion horizon/tests/test_data/nova_data.py
Expand Up @@ -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)

Expand Down

0 comments on commit 47f4459

Please sign in to comment.