Add Volume Size value in cluster instances details

Volume Size parameter was not shown for cluster instances.
This change makes Volue Size visible in instances table.

Change-Id: Iee819189f7ca49aeec579aa06d88911b0ac37b19
Signed-off-by: Marcin Piwowarczyk <m.piwowarczy@samsung.com>
This commit is contained in:
Marcin Piwowarczyk 2018-11-07 11:22:26 +01:00
parent bda4bd1850
commit 8e0d5bce17

View File

@ -209,6 +209,12 @@ def get_host(instance):
return _("Not Assigned")
def get_instance_volume_size(instance):
if hasattr(instance, "volume"):
return sizeformat.diskgbformat(instance.volume.get("size"))
return _("Not available")
class InstancesTable(tables.DataTable):
name = tables.Column("name",
verbose_name=_("Name"))
@ -219,6 +225,9 @@ class InstancesTable(tables.DataTable):
size = tables.Column(get_instance_size,
verbose_name=_("Size"),
attrs={'data-type': 'size'})
volume_size = tables.Column(get_instance_volume_size,
verbose_name=_("Volume Size"),
attrs={'data-type': 'size'})
status = tables.Column("status",
filters=(title, filters.replace_underscores),
verbose_name=_("Status"))