Make sahara permission check backward compatible

In kilo, the service type of sahara changed from data_processing
to data-processing.

We should be checking for both data-processing and data_processing
service for backward compatability.

Change-Id: I6f55938b7c9dedcacc2fd6ba27c14ecc4e8565e3
Closes-Bug: #1433816
This commit is contained in:
lin-hua-cheng 2015-03-18 16:08:59 -07:00
parent b79014ada1
commit 30d4b6d1f9
10 changed files with 21 additions and 10 deletions

View File

@ -21,7 +21,8 @@ from openstack_dashboard.dashboards.project import dashboard
class ClusterTemplatesPanel(horizon.Panel):
name = _("Cluster Templates")
slug = 'data_processing.cluster_templates'
permissions = ('openstack.services.data-processing',)
permissions = (('openstack.services.data-processing',
'openstack.services.data_processing'),)
dashboard.Project.register(ClusterTemplatesPanel)

View File

@ -21,7 +21,8 @@ from openstack_dashboard.dashboards.project import dashboard
class ClustersPanel(horizon.Panel):
name = _("Clusters")
slug = 'data_processing.clusters'
permissions = ('openstack.services.data-processing',)
permissions = (('openstack.services.data-processing',
'openstack.services.data_processing'),)
dashboard.Project.register(ClustersPanel)

View File

@ -21,7 +21,8 @@ from openstack_dashboard.dashboards.project import dashboard
class ImageRegistryPanel(horizon.Panel):
name = _("Image Registry")
slug = 'data_processing.data_image_registry'
permissions = ('openstack.services.data-processing',)
permissions = (('openstack.services.data-processing',
'openstack.services.data_processing'),)
dashboard.Project.register(ImageRegistryPanel)

View File

@ -21,6 +21,8 @@ from openstack_dashboard.dashboards.project import dashboard
class PluginsPanel(horizon.Panel):
name = _("Plugins")
slug = 'data_processing.data_plugins'
permissions = ('openstack.services.data-processing',)
permissions = (('openstack.services.data-processing',
'openstack.services.data_processing'),)
dashboard.Project.register(PluginsPanel)

View File

@ -21,7 +21,8 @@ from openstack_dashboard.dashboards.project import dashboard
class DataSourcesPanel(horizon.Panel):
name = _("Data Sources")
slug = 'data_processing.data_sources'
permissions = ('openstack.services.data-processing',)
permissions = (('openstack.services.data-processing',
'openstack.services.data_processing'),)
dashboard.Project.register(DataSourcesPanel)

View File

@ -21,7 +21,8 @@ from openstack_dashboard.dashboards.project import dashboard
class JobBinariesPanel(horizon.Panel):
name = _("Job Binaries")
slug = 'data_processing.job_binaries'
permissions = ('openstack.services.data-processing',)
permissions = (('openstack.services.data-processing',
'openstack.services.data_processing'),)
dashboard.Project.register(JobBinariesPanel)

View File

@ -21,7 +21,8 @@ from openstack_dashboard.dashboards.project import dashboard
class JobExecutionsPanel(horizon.Panel):
name = _("Job Executions")
slug = 'data_processing.job_executions'
permissions = ('openstack.services.data-processing',)
permissions = (('openstack.services.data-processing',
'openstack.services.data_processing'),)
dashboard.Project.register(JobExecutionsPanel)

View File

@ -21,7 +21,8 @@ from openstack_dashboard.dashboards.project import dashboard
class JobsPanel(horizon.Panel):
name = _("Jobs")
slug = 'data_processing.jobs'
permissions = ('openstack.services.data-processing',)
permissions = (('openstack.services.data-processing',
'openstack.services.data_processing'),)
dashboard.Project.register(JobsPanel)

View File

@ -21,7 +21,8 @@ from openstack_dashboard.dashboards.project import dashboard
class NodegroupTemplatesPanel(horizon.Panel):
name = _("Node Group Templates")
slug = 'data_processing.nodegroup_templates'
permissions = ('openstack.services.data-processing',)
permissions = (('openstack.services.data-processing',
'openstack.services.data_processing'),)
dashboard.Project.register(NodegroupTemplatesPanel)

View File

@ -21,7 +21,8 @@ from openstack_dashboard.dashboards.project import dashboard
class WizardPanel(horizon.Panel):
name = _("Guides")
slug = 'data_processing.wizard'
permissions = ('openstack.services.data-processing',)
permissions = (('openstack.services.data-processing',
'openstack.services.data_processing'),)
dashboard.Project.register(WizardPanel)