diff --git a/horizon/dashboards/nova/instances_and_volumes/instances/tables.py b/horizon/dashboards/nova/instances_and_volumes/instances/tables.py index 12c4bccf1..16d0e2ed6 100644 --- a/horizon/dashboards/nova/instances_and_volumes/instances/tables.py +++ b/horizon/dashboards/nova/instances_and_volumes/instances/tables.py @@ -59,6 +59,11 @@ class TerminateInstance(tables.BatchAction): data_type_plural = _("Instances") classes = ('btn-danger', 'btn-terminate') + def allowed(self, request, instance=None): + if instance: + return instance.status != "PAUSED" + return True + def action(self, request, obj_id): api.server_delete(request, obj_id) diff --git a/horizon/dashboards/syspanel/instances/tables.py b/horizon/dashboards/syspanel/instances/tables.py index 6f05cd735..ed9c8eb9b 100644 --- a/horizon/dashboards/syspanel/instances/tables.py +++ b/horizon/dashboards/syspanel/instances/tables.py @@ -48,6 +48,8 @@ class SyspanelInstancesTable(tables.DataTable): ) STATUS_CHOICES = ( ("active", True), + ("suspended", True), + ("paused", True), ("error", False), ) TASK_DISPLAY_CHOICES = (