Files
zaza-openstack-tests/zaza/openstack/utilities/exceptions.py
Felipe Reyes 11c3f80d5e resource_reaches_status: add new parameter stop_status
The stop_status parameter allows callers to ask stop retrying based on a
list of statuses that are known to be final (and error) states, this
saves time failing earlier.

Usage example for fail early when an instance reaches to ERROR status:

    openstack_utils.resource_reaches_status(self.nova_client.servers,
                                            instance_uuid,
                                            resource_attribute='state',
                                            expected_status='ACTIVE',
                                            stop_status='ERROR')
2023-08-24 19:38:11 -04:00

229 lines
4.3 KiB
Python

# Copyright 2018 Canonical 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.
"""Module of exceptions that zaza may raise."""
class InvalidTestConfig(Exception):
"""Exception when the test configuration is invalid."""
pass
class MissingOSAthenticationException(Exception):
"""Exception when some data needed to authenticate is missing."""
pass
class CloudInitIncomplete(Exception):
"""Cloud init has not completed properly."""
pass
class SSHFailed(Exception):
"""SSH failed."""
pass
class NeutronAgentMissing(Exception):
"""Agent binary does not appear in the Neutron agent list."""
pass
class NeutronBGPSpeakerMissing(Exception):
"""No BGP speaker appeared on agent."""
pass
class ApplicationNotFound(Exception):
"""Application not found in machines."""
def __init__(self, application):
"""Create Application not found exception.
:param application: Name of the application
:type application: string
:returns: ApplicationNotFound Exception
"""
msg = ("{} application was not found in machines.".
format(application))
super(ApplicationNotFound, self).__init__(msg)
class SeriesNotFound(Exception):
"""Series not found in status."""
pass
class OSVersionNotFound(Exception):
"""OS Version not found."""
pass
class ReleasePairNotFound(Exception):
"""Release pair was not found in OPENSTACK_RELEASES_PAIRS."""
pass
class KeystoneAuthorizationStrict(Exception):
"""Authorization/Policy too strict."""
pass
class KeystoneAuthorizationPermissive(Exception):
"""Authorization/Policy too permissive."""
pass
class KeystoneWrongTokenProvider(Exception):
"""A token was issued from the wrong token provider."""
pass
class KeystoneKeyRepositoryError(Exception):
"""Error in key repository.
This may be caused by isues with one of:
- incomplete or missing data in `key_repository` in leader storage
- synchronization of keys to non-leader units
- rotation of keys
"""
pass
class ProcessNameCountMismatch(Exception):
"""Count of process names doesn't match."""
pass
class ProcessNameMismatch(Exception):
"""Name of processes doesn't match."""
pass
class PIDCountMismatch(Exception):
"""PID's count doesn't match."""
pass
class ProcessIdsFailed(Exception):
"""Process ID lookup failed."""
pass
class UnitNotFound(Exception):
"""Unit not found in actual dict."""
pass
class UnitCountMismatch(Exception):
"""Count of unit doesn't match."""
pass
class UbuntuReleaseNotFound(Exception):
"""Ubuntu release not found in list."""
pass
class ServiceNotFound(Exception):
"""Service not found on unit."""
pass
class CephPoolNotFound(Exception):
"""Ceph pool not found."""
pass
class CephPoolNotConfigured(Exception):
"""Ceph pool not configured properly."""
pass
class CephGenericError(Exception):
"""A generic/other Ceph error occurred."""
pass
class NovaGuestMigrationFailed(Exception):
"""Nova guest migration failed."""
pass
class NovaGuestRestartFailed(Exception):
"""Nova guest restart failed."""
pass
class NovaGuestNoPingResponse(Exception):
"""Nova guest failed to respond to pings."""
pass
class PolicydError(Exception):
"""Policyd override failed."""
pass
class CACERTNotFound(Exception):
"""Could not find cacert."""
pass
class LoadBalancerUnexpectedState(Exception):
"""The LoadBalancer is in a unexpected state."""
pass
class LoadBalancerUnrecoverableError(Exception):
"""The LoadBalancer has reached to an unrecoverable error state."""
pass
class StatusError(Exception):
"""The resource status is in error state."""
pass