cinder-tempest-plugin/cinder_tempest_plugin/exceptions.py
Luigi Toscano f1432e10e1 Consistency groups: fix the exceptions handling
= Fix the imports of shared exceptions =

Shared tempest exceptions (like TimeoutException) are defined
in and exported by tempest.lib, so use them correctly.

= Directly define the exceptions used by this tempest plugin =

While those exceptions have been defined in tempest.lib through
I62e0ba556b884c94f6e8796a2e6f6d8083277fa4,
they really belongs to this plugin only, so define them here.
Other tempest plugins followed the same pattern.
Moreover, the current import would need to be fixed anyway,
because it should import the exceptions from tempest.lib.exceptions
instead of tempest.exceptions.

Closes-Bug: #1858417
Closes-Bug: #1889537
Change-Id: Ie54c2a1dc25b647a0f0d10bcad6ba62023986741
2020-07-30 12:22:37 +02:00

23 lines
929 B
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.
from tempest.lib import exceptions
class ConsistencyGroupException(exceptions.TempestException):
message = "Consistency group %(cg_id)s failed and is in ERROR status"
class ConsistencyGroupSnapshotException(exceptions.TempestException):
message = ("Consistency group snapshot %(cgsnapshot_id)s failed and is "
"in ERROR status")