Merge "Reduce dependency to tempest: exceptions"
This commit is contained in:
commit
2a4bd59d49
@ -17,18 +17,17 @@ import copy
|
||||
import inspect
|
||||
import traceback
|
||||
|
||||
from oslo_concurrency import lockutils # noqa
|
||||
from oslo_log import log # noqa
|
||||
import six # noqa
|
||||
from tempest_lib.common.utils import data_utils # noqa
|
||||
from tempest_lib import exceptions as lib_exc # noqa
|
||||
from oslo_concurrency import lockutils
|
||||
from oslo_log import log
|
||||
import six
|
||||
from tempest_lib.common.utils import data_utils
|
||||
from tempest_lib import exceptions
|
||||
|
||||
from tempest import clients_share as clients
|
||||
from tempest.common import isolated_creds
|
||||
from tempest import config_share as config
|
||||
from tempest import exceptions
|
||||
from tempest import share_exceptions
|
||||
from tempest import test
|
||||
from tempest import clients_share as clients # noqa
|
||||
from tempest.common import isolated_creds # noqa
|
||||
from tempest import config_share as config # noqa
|
||||
from tempest import share_exceptions # noqa
|
||||
from tempest import test # noqa
|
||||
|
||||
CONF = config.CONF
|
||||
LOG = log.getLogger(__name__)
|
||||
@ -37,7 +36,7 @@ LOG = log.getLogger(__name__)
|
||||
class handle_cleanup_exceptions(object):
|
||||
"""Handle exceptions raised with cleanup operations.
|
||||
|
||||
Always suppress errors when lib_exc.NotFound or lib_exc.Forbidden
|
||||
Always suppress errors when exceptions.NotFound or exceptions.Forbidden
|
||||
are raised.
|
||||
Suppress all other exceptions only in case config opt
|
||||
'suppress_errors_in_cleanup' in config group 'share' is True.
|
||||
@ -48,7 +47,7 @@ class handle_cleanup_exceptions(object):
|
||||
|
||||
def __exit__(self, exc_type, exc_value, exc_traceback):
|
||||
if not (isinstance(exc_value,
|
||||
(lib_exc.NotFound, lib_exc.Forbidden)) or
|
||||
(exceptions.NotFound, exceptions.Forbidden)) or
|
||||
CONF.share.suppress_errors_in_cleanup):
|
||||
return False # Do not suppress error if any
|
||||
if exc_traceback:
|
||||
|
@ -13,13 +13,13 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from oslo_log import log as logging # noqa
|
||||
from tempest_lib.common.utils import data_utils # noqa
|
||||
from oslo_log import log as logging
|
||||
from tempest_lib.common.utils import data_utils
|
||||
from tempest_lib import exceptions
|
||||
|
||||
from tempest import config
|
||||
from tempest import exceptions
|
||||
from tempest.scenario import manager_share as manager
|
||||
from tempest import test
|
||||
from tempest import config # noqa
|
||||
from tempest.scenario import manager_share as manager # noqa
|
||||
from tempest import test # noqa
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
|
@ -17,14 +17,13 @@ import json
|
||||
import time
|
||||
import urllib
|
||||
|
||||
import six # noqa
|
||||
from tempest_lib.common import rest_client # noqa
|
||||
from tempest_lib.common.utils import data_utils # noqa
|
||||
from tempest_lib import exceptions as lib_exc # noqa
|
||||
import six
|
||||
from tempest_lib.common import rest_client
|
||||
from tempest_lib.common.utils import data_utils
|
||||
from tempest_lib import exceptions
|
||||
|
||||
from tempest import config_share as config
|
||||
from tempest import exceptions
|
||||
from tempest import share_exceptions
|
||||
from tempest import config_share as config # noqa
|
||||
from tempest import share_exceptions # noqa
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
@ -392,7 +391,7 @@ class SharesClient(rest_client.RestClient):
|
||||
def _is_resource_deleted(self, func, res_id):
|
||||
try:
|
||||
res = func(res_id)
|
||||
except lib_exc.NotFound:
|
||||
except exceptions.NotFound:
|
||||
return True
|
||||
if res.get('status') == 'error_deleting':
|
||||
# Resource has "error_deleting" status and can not be deleted.
|
||||
|
@ -13,7 +13,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from tempest import exceptions
|
||||
from tempest_lib import exceptions
|
||||
|
||||
|
||||
class ShareBuildErrorException(exceptions.TempestException):
|
||||
|
Loading…
Reference in New Issue
Block a user