From 3b373cfaed0c25fabc7dbe95be86e7b491f8fbf3 Mon Sep 17 00:00:00 2001 From: Tihomir Trifonov Date: Wed, 15 May 2013 20:03:19 +0300 Subject: [PATCH] Allow "Create Snapshot" for SHUTOFF state Fix bug #1176604 Change-Id: Ifb0f8209e01799029f560b09b96467c7c789b6bf --- openstack_dashboard/dashboards/project/instances/tables.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openstack_dashboard/dashboards/project/instances/tables.py b/openstack_dashboard/dashboards/project/instances/tables.py index 346cb484f..ef46ad911 100644 --- a/openstack_dashboard/dashboards/project/instances/tables.py +++ b/openstack_dashboard/dashboards/project/instances/tables.py @@ -39,6 +39,7 @@ from .tabs import InstanceDetailTabs, LogTab, ConsoleTab LOG = logging.getLogger(__name__) ACTIVE_STATES = ("ACTIVE",) +SNAPSHOT_READY_STATES = ("ACTIVE", "SHUTOFF") POWER_STATES = { 0: "NO STATE", @@ -237,7 +238,8 @@ class CreateSnapshot(tables.LinkAction): classes = ("ajax-modal", "btn-camera") def allowed(self, request, instance=None): - return instance.status in ACTIVE_STATES and not is_deleting(instance) + return instance.status in SNAPSHOT_READY_STATES \ + and not is_deleting(instance) class ConsoleLink(tables.LinkAction): @@ -440,6 +442,7 @@ TASK_DISPLAY_CHOICES = ( class InstancesFilterAction(tables.FilterAction): + def filter(self, table, instances, filter_string): """ Naive case-insensitive search. """ q = filter_string.lower()