Make Task state translatable.

The Task state None is currently not translated because it is the
literal value None.  Update to make sure it gets displayed as translated.
Also add in other missing task_states: 'reboot_pending', 'reboot_started',
'reboot_pending_hard', 'reboot_started_hard'

Change-Id: I4f9f8d22711896b2e9d39ef1bf5e803ca7bcbc0a
Closes-Bug: #1392848
This commit is contained in:
Doug Fish 2014-11-14 14:04:45 -06:00
parent 7382c5d051
commit a60fa55a70
2 changed files with 12 additions and 2 deletions

View File

@ -144,7 +144,7 @@ class AdminInstancesTable(tables.DataTable):
display_choices=project_tables.STATUS_DISPLAY_CHOICES)
task = tables.Column("OS-EXT-STS:task_state",
verbose_name=_("Task"),
filters=(title, filters.replace_underscores),
empty_value=project_tables.TASK_DISPLAY_NONE,
status=True,
status_choices=TASK_STATUS_CHOICES,
display_choices=project_tables.TASK_DISPLAY_CHOICES)

View File

@ -838,7 +838,9 @@ STATUS_DISPLAY_CHOICES = (
u"Shelved Offloaded")),
)
TASK_DISPLAY_NONE = pgettext_lazy("Task status of an Instance", u"None")
# Mapping of task states taken from Nova's nova/compute/task_states.py
TASK_DISPLAY_CHOICES = (
("scheduling", pgettext_lazy("Task status of an Instance",
u"Scheduling")),
@ -872,8 +874,16 @@ TASK_DISPLAY_CHOICES = (
("resize_confirming", pgettext_lazy("Task status of an Instance",
u"Confirming Resize or Migrate")),
("rebooting", pgettext_lazy("Task status of an Instance", u"Rebooting")),
("reboot_pending", pgettext_lazy("Task status of an Instance",
u"Reboot Pending")),
("reboot_started", pgettext_lazy("Task status of an Instance",
u"Reboot Started")),
("rebooting_hard", pgettext_lazy("Task status of an Instance",
u"Rebooting Hard")),
("reboot_pending_hard", pgettext_lazy("Task status of an Instance",
u"Reboot Pending Hard")),
("reboot_started_hard", pgettext_lazy("Task status of an Instance",
u"Reboot Started Hard")),
("pausing", pgettext_lazy("Task status of an Instance", u"Pausing")),
("unpausing", pgettext_lazy("Task status of an Instance", u"Resuming")),
("suspending", pgettext_lazy("Task status of an Instance",
@ -966,7 +976,7 @@ class InstancesTable(tables.DataTable):
verbose_name=_("Availability Zone"))
task = tables.Column("OS-EXT-STS:task_state",
verbose_name=_("Task"),
filters=(title, filters.replace_underscores),
empty_value=TASK_DISPLAY_NONE,
status=True,
status_choices=TASK_STATUS_CHOICES,
display_choices=TASK_DISPLAY_CHOICES)