adjutant/stacktask/exceptions.py
adriant e1f9a5dfe0 Setup StackTask for plugins
* All non-admin urls are now set in the config.
* All taskviews are registered in the models.py file of api.v1
**  Based in part on how keystone handles it's own plugins, where
    the url will be defined in the modules, and the conf simply
    enables them. Less configurable, but safer.
* StackTask now does a startup check to confirm all expected
  taskviews and actions have been registered
**  Means we can add more startup sanity checks in future too.
* Taskviews 'default_action' is now 'default_actions'
**  'default_actions' can be overridden in conf
* TaskView settings 'actions' renamed to 'additional_actions'

Change-Id: Ic036407cbaf292830cbe60cbed4a8db0be5e87e3
2016-08-09 15:40:19 +12:00

31 lines
1.0 KiB
Python

# Copyright (C) 2015 Catalyst IT Ltd
#
# 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.
class BaseException(Exception):
"""An error occurred."""
def __init__(self, message=None):
self.message = message
def __str__(self):
return self.message or self.__class__.__doc__
class TaskViewNotFound(BaseException):
"""Attempting to setup TaskView that has not been registered."""
class ActionNotFound(BaseException):
"""Attempting to setup Action that has not been registered."""