os-faults/os_faults/api/error.py
Anton Studenov a5945210c6 [Core] Services as drivers
This patch move service definitions from classes to
drivers with default configurations.

* Driver are now loaded from all os_faults modules
  except tests folder.
* Registry now skips drivers without NAME.
* Registry now checks name collision.
* Added documentation for service drivers.

Change-Id: I58723bbb01a04e61836415392cf43be3e5fffff0
2017-04-17 17:20:27 +03:00

45 lines
1.2 KiB
Python

# 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 OSFException(Exception):
"""Base Exception class"""
class OSFError(OSFException):
"""Base Error class"""
class PowerManagementError(OSFError):
"""Base Error class for Power Management API"""
class CloudManagementError(OSFError):
"""Base Error class for Cloud Management API"""
class ServiceError(OSFError):
"""Base Error class for Service API"""
class NodeCollectionError(OSFError):
"""Base Error class for NodeCollection API"""
class OSFDriverNotFound(OSFError):
"""Driver Not Found by os-faults registry"""
class OSFDriverWithSuchNameExists(OSFError):
"""Driver with such name already exists in os-faults registry"""