From b1820e48570356ef210ebc377fdc39dfaf308d14 Mon Sep 17 00:00:00 2001 From: Gabriel Hurley Date: Sun, 25 Mar 2012 20:21:05 -0700 Subject: [PATCH] Replaces "_" with " " for instance status and task messages. Fixes bug 964320. Change-Id: Ia32f262a9f8f86e76c106758a38cc5d36bd909fc --- .../nova/instances_and_volumes/instances/tables.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/horizon/dashboards/nova/instances_and_volumes/instances/tables.py b/horizon/dashboards/nova/instances_and_volumes/instances/tables.py index 50364e3b898..7b13c0fc938 100644 --- a/horizon/dashboards/nova/instances_and_volumes/instances/tables.py +++ b/horizon/dashboards/nova/instances_and_volumes/instances/tables.py @@ -207,6 +207,10 @@ def get_power_state(instance): return POWER_STATES.get(getattr(instance, "OS-EXT-STS:power_state", 0), '') +def replace_underscores(string): + return string.replace("_", " ") + + class InstancesTable(tables.DataTable): TASK_STATUS_CHOICES = ( (None, True), @@ -224,17 +228,17 @@ class InstancesTable(tables.DataTable): ip = tables.Column(get_ips, verbose_name=_("IP Address")) size = tables.Column(get_size, verbose_name=_("Size")) status = tables.Column("status", - filters=(title,), + filters=(title, replace_underscores), verbose_name=_("Status"), status=True, status_choices=STATUS_CHOICES) task = tables.Column("OS-EXT-STS:task_state", verbose_name=_("Task"), - filters=(title,), + filters=(title, replace_underscores), status=True, status_choices=TASK_STATUS_CHOICES) state = tables.Column(get_power_state, - filters=(title,), + filters=(title, replace_underscores), verbose_name=_("Power State")) class Meta: