Source code for towerlib.towerlibexceptions

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: towerlibexceptions.py
#
# Copyright 2018 Costas Tyfoxylos
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
#  of this software and associated documentation files (the "Software"), to
#  deal in the Software without restriction, including without limitation the
#  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
#  sell copies of the Software, and to permit persons to whom the Software is
#  furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
#  all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
#  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
#  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
#  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
#  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
#  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
#  DEALINGS IN THE SOFTWARE.
#

"""
Custom exception code for towerlib.

.. _Google Python Style Guide:
   https://google.github.io/styleguide/pyguide.html

"""

__author__ = '''Costas Tyfoxylos <ctyfoxylos@schubergphilis.com>'''
__docformat__ = '''google'''
__date__ = '''2018-01-02'''
__copyright__ = '''Copyright 2018, Costas Tyfoxylos'''
__credits__ = ["Costas Tyfoxylos"]
__license__ = '''MIT'''
__maintainer__ = '''Costas Tyfoxylos'''
__email__ = '''<ctyfoxylos@schubergphilis.com>'''
__status__ = '''Development'''  # "Prototype", "Development", "Production".


[docs]class AuthFailed(Exception): """The token retrieval failed."""
[docs]class InvalidUserLevel(Exception): """The value provided is not allowed. Valid values ('standard', 'system_auditor', 'system_administrator') """
[docs]class InvalidOrganization(Exception): """The organization provided is not a valid organization."""
[docs]class InvalidVariables(Exception): """The variables are not valid json."""
[docs]class InvalidInventory(Exception): """The inventory provided is invalid."""
[docs]class InvalidInventoryScript(Exception): """The inventory script provided is invalid."""
[docs]class InvalidCredentialType(Exception): """The credential type provided is invalid."""
[docs]class InvalidUser(Exception): """The user provided is invalid."""
[docs]class InvalidTeam(Exception): """The team provided is invalid."""
[docs]class InvalidCredential(Exception): """The credential provided is invalid."""
[docs]class InvalidGroup(Exception): """The group provided is invalid."""
[docs]class InvalidHost(Exception): """The host provided is invalid."""
[docs]class InvalidProject(Exception): """The project provided is not valid."""
[docs]class InvalidJobType(Exception): """The job type provided is not valid. Valid values (u'run', u'check')."""
[docs]class InvalidPlaybook(Exception): """The playbook specified does not exist in the project."""
[docs]class InvalidInstanceGroup(Exception): """The instance group provided does not exist."""
[docs]class InvalidVerbosity(Exception): """The verbosity level provided is not valid. Valid values (0, 1, 2, 3, 4)."""
[docs]class InvalidJobTemplate(Exception): """The job template provided is not valid."""
[docs]class PermissionNotFound(Exception): """The permission was not found in the entity."""
[docs]class InvalidValue(Exception): """The value is not valid for the field."""
[docs]class InvalidRole(Exception): """The role is not valid for this organization."""
[docs]class InvalidSchedule(Exception): """The schedule is not valid for this job template."""
[docs]class FailedToDeleteTemplate(Exception): """The deletion of the job template failed."""