summaryrefslogtreecommitdiff
path: root/openstack_dashboard/dashboards/project/stacks/template_versions/tabs.py
diff options
context:
space:
mode:
Diffstat (limited to 'openstack_dashboard/dashboards/project/stacks/template_versions/tabs.py')
-rw-r--r--openstack_dashboard/dashboards/project/stacks/template_versions/tabs.py51
1 files changed, 0 insertions, 51 deletions
diff --git a/openstack_dashboard/dashboards/project/stacks/template_versions/tabs.py b/openstack_dashboard/dashboards/project/stacks/template_versions/tabs.py
deleted file mode 100644
index 9cb9096..0000000
--- a/openstack_dashboard/dashboards/project/stacks/template_versions/tabs.py
+++ /dev/null
@@ -1,51 +0,0 @@
1# Licensed under the Apache License, Version 2.0 (the "License");
2# you may not use this file except in compliance with the License.
3# You may obtain a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS,
9# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
10# implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14from django.utils.translation import ugettext_lazy as _
15
16from horizon import messages
17from horizon import tabs
18from openstack_dashboard import api
19from openstack_dashboard import policy
20
21from openstack_dashboard.dashboards.project.stacks.template_versions \
22 import tables as project_tables
23
24
25class TemplateFunctionsTab(tabs.Tab):
26 name = _("Template Functions")
27 slug = "template_functions"
28 template_name = "project/stacks.template_versions/_details.html"
29 preload = False
30
31 def allowed(self, request):
32 return policy.check(
33 (("orchestration", "stacks:list_template_functions"),),
34 request)
35
36 def get_context_data(self, request):
37 template_version = self.tab_group.kwargs['template_version']
38 try:
39 template_functions = api.heat.template_function_list(
40 self.request, template_version)
41 except Exception:
42 template_functions = []
43 messages.error(request, _('Unable to get functions for template '
44 'version "%s".') % template_version)
45 return {"table": project_tables.TemplateFunctionsTable(
46 request, data=template_functions), }
47
48
49class TemplateVersionDetailsTabs(tabs.TabGroup):
50 slug = "template_version_details"
51 tabs = (TemplateFunctionsTab,)