Browse Source

Merge "Allow shelving instance for SHUTOFF/PAUSED/SUSPENDED statuses" into stable/ocata

Jenkins 2 years ago
parent
commit
d011d85926
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      openstack_dashboard/dashboards/project/instances/tables.py

+ 2
- 1
openstack_dashboard/dashboards/project/instances/tables.py View File

@@ -50,6 +50,7 @@ LOG = logging.getLogger(__name__)
50 50
 ACTIVE_STATES = ("ACTIVE",)
51 51
 VOLUME_ATTACH_READY_STATES = ("ACTIVE", "SHUTOFF")
52 52
 SNAPSHOT_READY_STATES = ("ACTIVE", "SHUTOFF", "PAUSED", "SUSPENDED")
53
+SHELVE_READY_STATES = ("ACTIVE", "SHUTOFF", "PAUSED", "SUSPENDED")
53 54
 
54 55
 POWER_STATES = {
55 56
     0: "NO STATE",
@@ -361,7 +362,7 @@ class ToggleShelve(tables.BatchAction):
361 362
             target={'project_id': getattr(instance, 'tenant_id', None)})
362 363
 
363 364
         return (has_permission
364
-                and (instance.status in ACTIVE_STATES or self.shelved)
365
+                and (instance.status in SHELVE_READY_STATES or self.shelved)
365 366
                 and not is_deleting(instance))
366 367
 
367 368
     def action(self, request, obj_id):

Loading…
Cancel
Save