From 19865eec5bc4a5a0ee402a55295dda2e52c2422c Mon Sep 17 00:00:00 2001
From: Edward Hope-Morley <edward.hope-morley@canonical.com>
Date: Wed, 26 Sep 2018 15:36:03 +0100
Subject: [PATCH] Add enabled check in Backups panel

If enable_backup is False in OPENSTACK_CINDER_FEATURES
then we should not display the backups panel.

Change-Id: I276eebf0f11406bf354f5d8bbecef7b244d6d340
Closes-Bug: #1778771
(cherry picked from commit 6c2225bab8b007023e031d829bc72e8e50e6f1df)
---
 openstack_dashboard/dashboards/project/backups/panel.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/openstack_dashboard/dashboards/project/backups/panel.py b/openstack_dashboard/dashboards/project/backups/panel.py
index efd7939d99..063a6d8538 100644
--- a/openstack_dashboard/dashboards/project/backups/panel.py
+++ b/openstack_dashboard/dashboards/project/backups/panel.py
@@ -14,6 +14,8 @@
 
 from django.utils.translation import ugettext_lazy as _
 
+from openstack_dashboard import api
+
 import horizon
 
 
@@ -25,3 +27,7 @@ class Backups(horizon.Panel):
          'openstack.services.volumev3'),
     )
     policy_rules = (("volume", "backup:get_all"),)
+
+    @staticmethod
+    def can_register():
+        return api.cinder.volume_backup_supported(None)
-- 
GitLab