Skip to content

Commit

Permalink
Replaces "_" with " " for instance status and task messages.
Browse files Browse the repository at this point in the history
Fixes bug 964320.

Change-Id: Ia32f262a9f8f86e76c106758a38cc5d36bd909fc
  • Loading branch information
gabrielhurley authored and jeblair committed Apr 3, 2012
1 parent a862b1c commit b1820e4
Showing 1 changed file with 7 additions and 3 deletions.
Expand Up @@ -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),
Expand All @@ -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:
Expand Down

0 comments on commit b1820e4

Please sign in to comment.