diff --git a/armada/exceptions/api_exceptions.py b/armada/exceptions/api_exceptions.py index 9b68719f..6640e814 100644 --- a/armada/exceptions/api_exceptions.py +++ b/armada/exceptions/api_exceptions.py @@ -16,9 +16,14 @@ from armada.exceptions import base_exception as base class ApiException(base.ArmadaBaseException): - '''Base class for API exceptions and error handling.''' + ''' + Base class for API exceptions and error handling. - message = 'An unknown API error occur.' + **Troubleshoot:** + *Coming Soon* + ''' + + message = 'An unknown API error occurred.' class ApiBaseException(ApiException): @@ -34,18 +39,33 @@ class ApiJsonException(ApiException): class ClientUnauthorizedError(ApiException): - '''Exception that occurs during chart cleanup.''' + ''' + Exception that occurs when the server returns a 401 Unauthorized error. + + **Troubleshoot:** + *Coming Soon* + ''' message = 'There was an error listing the Helm chart releases.' class ClientForbiddenError(ApiException): - '''Exception that occurs during chart cleanup.''' + ''' + Exception that occurs when the server returns a 403 Forbidden error. + + **Troubleshoot:** + *Coming Soon* + ''' message = 'There was an error listing the Helm chart releases.' class ClientError(ApiException): - '''Exception that occurs during chart cleanup.''' + ''' + Exception that occurs when the server returns a 500 Internal Server error. + + **Troubleshoot:** + *Coming Soon* + ''' message = 'There was an error listing the Helm chart releases.' diff --git a/armada/exceptions/armada_exceptions.py b/armada/exceptions/armada_exceptions.py index 82fe9e72..80711d8b 100644 --- a/armada/exceptions/armada_exceptions.py +++ b/armada/exceptions/armada_exceptions.py @@ -18,7 +18,7 @@ from armada.exceptions import base_exception class ArmadaException(base_exception.ArmadaBaseException): '''Base class for Armada handler exception and error handling.''' - message = 'An unknown Armada handler error occured.' + message = 'An unknown Armada handler error occurred.' class KnownReleasesException(ArmadaException): diff --git a/armada/exceptions/chartbuilder_exceptions.py b/armada/exceptions/chartbuilder_exceptions.py index 5b2d1836..3c94d001 100644 --- a/armada/exceptions/chartbuilder_exceptions.py +++ b/armada/exceptions/chartbuilder_exceptions.py @@ -46,7 +46,7 @@ class HelmChartBuildException(ChartBuilderException): class IgnoredFilesLoadException(ChartBuilderException): '''Exception that occurs when there is an error loading ignored files.''' - message = 'An error occured while loading the ignored files in \ + message = 'An error occurred while loading the ignored files in \ .helmignore' diff --git a/armada/exceptions/lint_exceptions.py b/armada/exceptions/lint_exceptions.py index aa0ead76..784c6f4e 100644 --- a/armada/exceptions/lint_exceptions.py +++ b/armada/exceptions/lint_exceptions.py @@ -18,7 +18,7 @@ from armada.exceptions import base_exception class LintException(base_exception.ArmadaBaseException): '''Base class for linting exceptions and errors.''' - message = 'An unknown linting error occured.' + message = 'An unknown linting error occurred.' class InvalidManifestException(LintException): @@ -30,13 +30,13 @@ class InvalidManifestException(LintException): class InvalidChartNameException(LintException): '''Exception that occurs when an invalid filename is encountered.''' - message = 'Chart name must be a string,' + message = 'Chart name must be a string.' class InvalidChartDefinitionException(LintException): '''Exception when invalid chart definition is encountered.''' - message = 'Invalid chart definition.Chart definition must be array.' + message = 'Invalid chart definition. Chart definition must be array.' class InvalidReleaseException(LintException): diff --git a/armada/exceptions/override_exceptions.py b/armada/exceptions/override_exceptions.py index c1f2b09f..8ea9fc0a 100644 --- a/armada/exceptions/override_exceptions.py +++ b/armada/exceptions/override_exceptions.py @@ -20,7 +20,7 @@ class OverrideException(base_exception.ArmadaBaseException): Base class for Override handler exception and error handling. ''' - message = 'An unknown Override handler error occured.' + message = 'An unknown Override handler error occurred.' class InvalidOverrideTypeException(OverrideException): diff --git a/armada/exceptions/tiller_exceptions.py b/armada/exceptions/tiller_exceptions.py index 861ab27a..8b08b4ed 100644 --- a/armada/exceptions/tiller_exceptions.py +++ b/armada/exceptions/tiller_exceptions.py @@ -87,7 +87,10 @@ class PreUpdateJobCreateException(TillerException): class ReleaseException(TillerException): - '''Exception that occurs when a release fails to install.''' + ''' + Exception that occurs when a release fails to install, upgrade, delete, + or test. + ''' def __init__(self, name, status, action): til_msg = getattr(status.info, 'Description').encode() @@ -124,8 +127,9 @@ class GetReleaseContentException(TillerException): class TillerPodNotFoundException(TillerException): - '''Exception that occurs when a tiller pod cannot be found using the - labels specified in the Armada config. + ''' + Exception that occurs when a tiller pod cannot be found using the labels + specified in the Armada config. ''' def __init__(self, labels): diff --git a/docs/source/operations/exceptions/api-exceptions.inc b/docs/source/operations/exceptions/api-exceptions.inc new file mode 100644 index 00000000..6be33549 --- /dev/null +++ b/docs/source/operations/exceptions/api-exceptions.inc @@ -0,0 +1,42 @@ +.. + Copyright 2018 AT&T Intellectual Property. + All Rights Reserved. + + 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. + +.. list-table:: **Api Exceptions** + :widths: 5 50 + :header-rows: 1 + + * - Exception Name + - Description + * - ApiException + - .. autoexception:: armada.exceptions.api_exceptions.ApiException + :members: + :show-inheritance: + :undoc-members: + * - ClientError + - .. autoexception:: armada.exceptions.api_exceptions.ClientError + :members: + :show-inheritance: + :undoc-members: + * - ClientForbiddenError + - .. autoexception:: armada.exceptions.api_exceptions.ClientForbiddenError + :members: + :show-inheritance: + :undoc-members: + * - ClientUnauthorizedError + - .. autoexception:: armada.exceptions.api_exceptions.ClientUnauthorizedError + :members: + :show-inheritance: + :undoc-members: diff --git a/docs/source/operations/exceptions/guide-exceptions.rst b/docs/source/operations/exceptions/guide-exceptions.rst new file mode 100644 index 00000000..32a5207d --- /dev/null +++ b/docs/source/operations/exceptions/guide-exceptions.rst @@ -0,0 +1,20 @@ +.. + Copyright 2018 AT&T Intellectual Property. + All Rights Reserved. + + 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. + +Armada Exceptions +================= + +.. include:: api-exceptions.inc diff --git a/docs/source/operations/exceptions/index.rst b/docs/source/operations/exceptions/index.rst new file mode 100644 index 00000000..870965cc --- /dev/null +++ b/docs/source/operations/exceptions/index.rst @@ -0,0 +1,24 @@ +.. + Copyright 2018 AT&T Intellectual Property. + All Rights Reserved. + + 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. + +Exceptions Guide +================ + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + guide-exceptions.rst diff --git a/docs/source/operations/guide-exceptions.rst b/docs/source/operations/guide-exceptions.rst deleted file mode 100644 index 1874f470..00000000 --- a/docs/source/operations/guide-exceptions.rst +++ /dev/null @@ -1,101 +0,0 @@ -Armada Exceptions -================= - -+------------------------+----------------------------------------------------------+ -| Exception | Error Description | -+========================+==========================================================+ -| KnownReleasesException | Occurs when no known releases are found. | -+------------------------+----------------------------------------------------------+ - -Tiller Exceptions -================= - -+------------------------------------+--------------------------------------------------------------------------------------------+ -| Exception | Error Description | -+====================================+============================================================================================+ -| ChartCleanupException | An error occurred removing a chart. | -+------------------------------------+--------------------------------------------------------------------------------------------+ -| ListChartsException | An error occurred listing helm charts. | -+------------------------------------+--------------------------------------------------------------------------------------------+ -| PostUpdateJobDeleteException | An error occurred deleting a job after an update. | -+------------------------------------+--------------------------------------------------------------------------------------------+ -| PostUpdateJobCreateException | An error occurred creating a job after an update. | -+------------------------------------+--------------------------------------------------------------------------------------------+ -| PreUpdateJobDeleteException | An error occurred deleting a job before an update. | -+------------------------------------+--------------------------------------------------------------------------------------------+ -| PreUpdateJobCreateException | An error occurred creating a job before an update. | -+------------------------------------+--------------------------------------------------------------------------------------------+ -| ReleaseUninstallException | A release failed to uninstall. | -+------------------------------------+--------------------------------------------------------------------------------------------+ -| ReleaseInstallException | A release failed to install. | -+------------------------------------+--------------------------------------------------------------------------------------------+ -| ReleaseUpdateException | A release failed to update. | -+------------------------------------+--------------------------------------------------------------------------------------------+ -| TillerPodNotFoundException | Tiller pod could not be found using the labels specified in the Armada config. | -+------------------------------------+--------------------------------------------------------------------------------------------+ -| TillerPodNotRunningException | Tiller pod was found but is not in a running state. | -+------------------------------------+--------------------------------------------------------------------------------------------+ -| TillerServicesUnavailableException | Occurs when Tiller services are unavailable. | -+------------------------------------+--------------------------------------------------------------------------------------------+ - -Chartbuilder Exceptions -======================= - -+-----------------------------+-------------------------------------------------------------+ -| Exception | Error Description | -+=============================+=============================================================+ -| DepedencyException | A dependency failed to install. | -+-----------------------------+-------------------------------------------------------------+ -| HelmChartBuildException | An error occurred building the chart. | -+-----------------------------+-------------------------------------------------------------+ -| IgnoredFilesLoadException | An error occurred loading the ignored files. | -+-----------------------------+-------------------------------------------------------------+ -| MetadataLoadException | An error occurred loading the metadata for a chart. | -+-----------------------------+-------------------------------------------------------------+ -| UnknownChartSourceException | The chart source is unknown or invalid. | -+-----------------------------+-------------------------------------------------------------+ - -Source Exceptions -================= - -+--------------------------+---------------------------------------------------------------------+ -| Exception | Error Description | -+==========================+=====================================================================+ -| GitLocationException | Repository location is not valid. | -+--------------------------+---------------------------------------------------------------------+ -| SourceCleanupException | The source dir of a chart no longer exists. | -+--------------------------+---------------------------------------------------------------------+ -| TarballDownloadException | Occurs when the tarball cannot be downloaded from the provided URL. | -+--------------------------+---------------------------------------------------------------------+ -| TarballExtractException | Occurs when extracting a tarball fails. | -+--------------------------+---------------------------------------------------------------------+ -| InvalidPathException | Occurs when a non-existent path is accessed. | -+--------------------------+---------------------------------------------------------------------+ -| ChartSourceException | Occurs when an unknown chart source type is encountered. | -+--------------------------+---------------------------------------------------------------------+ - -Lint Exceptions -=============== -+----------------------------------+------------------------------+ -| Exception | Error Description | -+==================================+==============================+ -| InvalidManifestException | Armada manifest invalid. | -+----------------------------------+------------------------------+ -| InvalidChartNameException | Chart name invalid. | -+----------------------------------+------------------------------+ -| InvalidChartDefinitionException | Chart definition invalid. | -+----------------------------------+------------------------------+ -| InvalidReleaseException | Release invalid. | -+----------------------------------+------------------------------+ -| InvalidArmadaObjectException | Armada object not declared. | -+----------------------------------+------------------------------+ - -Manifest Exceptions -=================== -+----------------------------------+------------------------------------------------+ -| Exception | Error Description | -+==================================+================================================+ -| ManifestException | An exception occurred while attempting to build| -| | an Armada manifest. The exception will return | -| | with details as to why. | -+----------------------------------+------------------------------------------------+ diff --git a/docs/source/operations/index.rst b/docs/source/operations/index.rst index beecde49..4c2e6053 100644 --- a/docs/source/operations/index.rst +++ b/docs/source/operations/index.rst @@ -15,7 +15,7 @@ Operations Guide guide-configure.rst guide-troubleshooting.rst guide-use-armada.rst - guide-exceptions.rst + exceptions/index guide-helm-plugin.rst sampleconf.rst samplepolicy.rst