Moving exception specification

Horizon defines classes of exception from the services it
communicates with. In the plugin case, the plugin needs to set
up including plugin content specific exceptions to the classes of
exceptions in Horizon. This patch includes this content.

Setting up an extensible exception list in exceptions.py and
including the exceptions in the configuration files.

Change-Id: Ie91cfe1e0f34a710a96b4a43cf62af35d989920c
This commit is contained in:
David Lyle 2015-12-01 13:23:33 -07:00
parent 6c5898813c
commit 0d3bead819
11 changed files with 68 additions and 0 deletions

View File

@ -10,6 +10,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from sahara_dashboard import exceptions
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'data_processing.wizard'
@ -22,3 +23,7 @@ PANEL_GROUP = 'data_processing'
ADD_PANEL = \
('sahara_dashboard.'
'content.data_processing.wizard.panel.WizardPanel')
ADD_EXCEPTIONS = {
'recoverable': exceptions.RECOVERABLE
}

View File

@ -10,6 +10,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from sahara_dashboard import exceptions
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'data_processing.clusters'
@ -29,3 +30,7 @@ ADD_INSTALLED_APPS = \
ADD_JS_FILES = [
'dashboard/project/data_processing/data_processing.event_log.js'
]
ADD_EXCEPTIONS = {
'recoverable': exceptions.RECOVERABLE
}

View File

@ -10,6 +10,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from sahara_dashboard import exceptions
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'data_processing.job_executions'
@ -22,3 +23,7 @@ PANEL_GROUP = 'data_processing'
ADD_PANEL = \
('sahara_dashboard.'
'content.data_processing.job_executions.panel.JobExecutionsPanel')
ADD_EXCEPTIONS = {
'recoverable': exceptions.RECOVERABLE
}

View File

@ -10,6 +10,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from sahara_dashboard import exceptions
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'data_processing.cluster_templates'
@ -22,3 +23,7 @@ PANEL_GROUP = 'data_processing'
ADD_PANEL = \
('sahara_dashboard.'
'content.data_processing.cluster_templates.panel.ClusterTemplatesPanel')
ADD_EXCEPTIONS = {
'recoverable': exceptions.RECOVERABLE
}

View File

@ -10,6 +10,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from sahara_dashboard import exceptions
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'data_processing.nodegroup_templates'
@ -23,3 +24,7 @@ ADD_PANEL = \
('sahara_dashboard.'
'content.data_processing.nodegroup_templates.panel.'
'NodegroupTemplatesPanel')
ADD_EXCEPTIONS = {
'recoverable': exceptions.RECOVERABLE
}

View File

@ -10,6 +10,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from sahara_dashboard import exceptions
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'data_processing.jobs'
@ -25,3 +26,7 @@ ADD_JS_FILES = [
'dashboard/project/data_processing/'
'data_processing.job_interface_arguments.js'
]
ADD_EXCEPTIONS = {
'recoverable': exceptions.RECOVERABLE
}

View File

@ -10,6 +10,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from sahara_dashboard import exceptions
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'data_processing.job_binaries'
@ -22,3 +23,7 @@ PANEL_GROUP = 'data_processing'
ADD_PANEL = \
('sahara_dashboard.'
'content.data_processing.job_binaries.panel.JobBinariesPanel')
ADD_EXCEPTIONS = {
'recoverable': exceptions.RECOVERABLE
}

View File

@ -10,6 +10,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from sahara_dashboard import exceptions
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'data_processing.data_sources'
@ -22,3 +23,7 @@ PANEL_GROUP = 'data_processing'
ADD_PANEL = \
('sahara_dashboard.'
'content.data_processing.data_sources.panel.DataSourcesPanel')
ADD_EXCEPTIONS = {
'recoverable': exceptions.RECOVERABLE
}

View File

@ -10,6 +10,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from sahara_dashboard import exceptions
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'data_processing.data_image_registry'
@ -22,3 +23,7 @@ PANEL_GROUP = 'data_processing'
ADD_PANEL = \
('sahara_dashboard.'
'content.data_processing.data_image_registry.panel.ImageRegistryPanel')
ADD_EXCEPTIONS = {
'recoverable': exceptions.RECOVERABLE
}

View File

@ -10,6 +10,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from sahara_dashboard import exceptions
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'data_processing.data_plugins'
@ -22,3 +23,7 @@ PANEL_GROUP = 'data_processing'
ADD_PANEL = \
('sahara_dashboard.'
'content.data_processing.data_plugins.panel.PluginsPanel')
ADD_EXCEPTIONS = {
'recoverable': exceptions.RECOVERABLE
}

View File

@ -0,0 +1,18 @@
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from saharaclient.api import base as saharaclient
RECOVERABLE = (
saharaclient.APIException,
)