From 485841b255e1bf59a64c285b6b3971577ce87811 Mon Sep 17 00:00:00 2001 From: Rishabh Dave Date: Tue, 15 Jun 2021 18:25:22 +0530 Subject: [PATCH] qa: import CommandFailedError from exceptions not run Stop importing CommandFailedError from teuthology.orchestra.run, it is actually defined in teuthology.exception. Fixes: https://tracker.ceph.com/issues/51226 Signed-off-by: Rishabh Dave --- qa/tasks/ceph_test_case.py | 2 +- qa/tasks/cephfs/cephfs_test_case.py | 2 +- qa/tasks/cephfs/fuse_mount.py | 2 +- qa/tasks/cephfs/kernel_mount.py | 2 +- qa/tasks/cephfs/mount.py | 3 ++- qa/tasks/cephfs/test_admin.py | 3 ++- qa/tasks/cephfs/test_auto_repair.py | 2 +- qa/tasks/cephfs/test_cephfs_shell.py | 2 +- qa/tasks/cephfs/test_client_recovery.py | 2 +- qa/tasks/cephfs/test_data_scan.py | 2 +- qa/tasks/cephfs/test_exports.py | 2 +- qa/tasks/cephfs/test_forward_scrub.py | 2 +- qa/tasks/cephfs/test_full.py | 2 +- qa/tasks/cephfs/test_misc.py | 2 +- qa/tasks/cephfs/test_multifs_auth.py | 2 +- qa/tasks/cephfs/test_multimds_misc.py | 2 +- qa/tasks/cephfs/test_recovery_pool.py | 2 +- qa/tasks/cephfs/test_snapshots.py | 3 ++- qa/tasks/cephfs/test_strays.py | 3 ++- qa/tasks/kclient.py | 2 +- qa/tasks/mds_creation_failure.py | 3 ++- qa/tasks/vstart_runner.py | 2 +- qa/tasks/workunit.py | 2 +- 23 files changed, 28 insertions(+), 23 deletions(-) diff --git a/qa/tasks/ceph_test_case.py b/qa/tasks/ceph_test_case.py index 7040853dfb4..0ce9e81f1c1 100644 --- a/qa/tasks/ceph_test_case.py +++ b/qa/tasks/ceph_test_case.py @@ -3,7 +3,7 @@ import unittest import time import logging -from teuthology.orchestra.run import CommandFailedError +from teuthology.exceptions import CommandFailedError if TYPE_CHECKING: from tasks.mgr.mgr_test_case import MgrCluster diff --git a/qa/tasks/cephfs/cephfs_test_case.py b/qa/tasks/cephfs/cephfs_test_case.py index 6b3460ff248..8383359d5aa 100644 --- a/qa/tasks/cephfs/cephfs_test_case.py +++ b/qa/tasks/cephfs/cephfs_test_case.py @@ -9,7 +9,7 @@ from tasks.ceph_test_case import CephTestCase from teuthology import contextutil from teuthology.orchestra import run -from teuthology.orchestra.run import CommandFailedError +from teuthology.exceptions import CommandFailedError log = logging.getLogger(__name__) diff --git a/qa/tasks/cephfs/fuse_mount.py b/qa/tasks/cephfs/fuse_mount.py index 5f4978e5715..8ecaab7b78b 100644 --- a/qa/tasks/cephfs/fuse_mount.py +++ b/qa/tasks/cephfs/fuse_mount.py @@ -8,7 +8,7 @@ from textwrap import dedent from teuthology.contextutil import MaxWhileTries from teuthology.contextutil import safe_while from teuthology.orchestra import run -from teuthology.orchestra.run import CommandFailedError +from teuthology.exceptions import CommandFailedError from tasks.ceph_manager import get_valgrind_args from tasks.cephfs.mount import CephFSMount diff --git a/qa/tasks/cephfs/kernel_mount.py b/qa/tasks/cephfs/kernel_mount.py index 55fdae5d9e8..9d14f4d749a 100644 --- a/qa/tasks/cephfs/kernel_mount.py +++ b/qa/tasks/cephfs/kernel_mount.py @@ -6,7 +6,7 @@ import re from io import StringIO from textwrap import dedent -from teuthology.orchestra.run import CommandFailedError +from teuthology.exceptions import CommandFailedError from teuthology.orchestra import run from teuthology.contextutil import MaxWhileTries diff --git a/qa/tasks/cephfs/mount.py b/qa/tasks/cephfs/mount.py index 6224a7eae7b..dccac187db6 100644 --- a/qa/tasks/cephfs/mount.py +++ b/qa/tasks/cephfs/mount.py @@ -14,7 +14,8 @@ from IPy import IP from teuthology.contextutil import safe_while from teuthology.misc import get_file, write_file from teuthology.orchestra import run -from teuthology.orchestra.run import CommandFailedError, ConnectionLostError, Raw +from teuthology.orchestra.run import Raw +from teuthology.exceptions import CommandFailedError, ConnectionLostError from tasks.cephfs.filesystem import Filesystem diff --git a/qa/tasks/cephfs/test_admin.py b/qa/tasks/cephfs/test_admin.py index aff83b86797..d7a083d72ec 100644 --- a/qa/tasks/cephfs/test_admin.py +++ b/qa/tasks/cephfs/test_admin.py @@ -6,7 +6,8 @@ import uuid from io import StringIO from os.path import join as os_path_join -from teuthology.orchestra.run import CommandFailedError, Raw +from teuthology.orchestra.run import Raw +from teuthology.exceptions import CommandFailedError from tasks.cephfs.cephfs_test_case import CephFSTestCase from tasks.cephfs.filesystem import FileLayout, FSMissing diff --git a/qa/tasks/cephfs/test_auto_repair.py b/qa/tasks/cephfs/test_auto_repair.py index 00c86b68bf6..e6f0a8f0bd4 100644 --- a/qa/tasks/cephfs/test_auto_repair.py +++ b/qa/tasks/cephfs/test_auto_repair.py @@ -6,7 +6,7 @@ Exercise the MDS's auto repair functions import logging import time -from teuthology.orchestra.run import CommandFailedError +from teuthology.exceptions import CommandFailedError from tasks.cephfs.cephfs_test_case import CephFSTestCase diff --git a/qa/tasks/cephfs/test_cephfs_shell.py b/qa/tasks/cephfs/test_cephfs_shell.py index 83ee3991196..1ee5c7f8464 100644 --- a/qa/tasks/cephfs/test_cephfs_shell.py +++ b/qa/tasks/cephfs/test_cephfs_shell.py @@ -10,7 +10,7 @@ from tempfile import mkstemp as tempfile_mkstemp import math from time import sleep from tasks.cephfs.cephfs_test_case import CephFSTestCase -from teuthology.orchestra.run import CommandFailedError +from teuthology.exceptions import CommandFailedError log = logging.getLogger(__name__) diff --git a/qa/tasks/cephfs/test_client_recovery.py b/qa/tasks/cephfs/test_client_recovery.py index 24726b369f9..eea93939d24 100644 --- a/qa/tasks/cephfs/test_client_recovery.py +++ b/qa/tasks/cephfs/test_client_recovery.py @@ -11,7 +11,7 @@ import re import os from teuthology.orchestra import run -from teuthology.orchestra.run import CommandFailedError +from teuthology.exceptions import CommandFailedError from tasks.cephfs.fuse_mount import FuseMount from tasks.cephfs.cephfs_test_case import CephFSTestCase from teuthology.packaging import get_package_version diff --git a/qa/tasks/cephfs/test_data_scan.py b/qa/tasks/cephfs/test_data_scan.py index dcb7eda40a5..177ffe01eaa 100644 --- a/qa/tasks/cephfs/test_data_scan.py +++ b/qa/tasks/cephfs/test_data_scan.py @@ -13,7 +13,7 @@ from io import BytesIO, StringIO from collections import namedtuple, defaultdict from textwrap import dedent -from teuthology.orchestra.run import CommandFailedError +from teuthology.exceptions import CommandFailedError from tasks.cephfs.cephfs_test_case import CephFSTestCase, for_teuthology log = logging.getLogger(__name__) diff --git a/qa/tasks/cephfs/test_exports.py b/qa/tasks/cephfs/test_exports.py index d2421bedcbb..4961edb520d 100644 --- a/qa/tasks/cephfs/test_exports.py +++ b/qa/tasks/cephfs/test_exports.py @@ -3,7 +3,7 @@ import random import time from tasks.cephfs.fuse_mount import FuseMount from tasks.cephfs.cephfs_test_case import CephFSTestCase -from teuthology.orchestra.run import CommandFailedError +from teuthology.exceptions import CommandFailedError log = logging.getLogger(__name__) diff --git a/qa/tasks/cephfs/test_forward_scrub.py b/qa/tasks/cephfs/test_forward_scrub.py index 82630e06958..ab97a6f596c 100644 --- a/qa/tasks/cephfs/test_forward_scrub.py +++ b/qa/tasks/cephfs/test_forward_scrub.py @@ -14,7 +14,7 @@ from collections import namedtuple from io import BytesIO from textwrap import dedent -from teuthology.orchestra.run import CommandFailedError +from teuthology.exceptions import CommandFailedError from tasks.cephfs.cephfs_test_case import CephFSTestCase import struct diff --git a/qa/tasks/cephfs/test_full.py b/qa/tasks/cephfs/test_full.py index 2b7166d6b2b..962a3d036d1 100644 --- a/qa/tasks/cephfs/test_full.py +++ b/qa/tasks/cephfs/test_full.py @@ -7,7 +7,7 @@ try: except: # make it work for python2 pass -from teuthology.orchestra.run import CommandFailedError +from teuthology.exceptions import CommandFailedError from tasks.cephfs.fuse_mount import FuseMount from tasks.cephfs.cephfs_test_case import CephFSTestCase diff --git a/qa/tasks/cephfs/test_misc.py b/qa/tasks/cephfs/test_misc.py index 85b11cc6ca0..0367c141f29 100644 --- a/qa/tasks/cephfs/test_misc.py +++ b/qa/tasks/cephfs/test_misc.py @@ -2,7 +2,7 @@ from io import StringIO from tasks.cephfs.fuse_mount import FuseMount from tasks.cephfs.cephfs_test_case import CephFSTestCase -from teuthology.orchestra.run import CommandFailedError +from teuthology.exceptions import CommandFailedError import errno import time import json diff --git a/qa/tasks/cephfs/test_multifs_auth.py b/qa/tasks/cephfs/test_multifs_auth.py index 2b28c61ca04..6768d57cfc0 100644 --- a/qa/tasks/cephfs/test_multifs_auth.py +++ b/qa/tasks/cephfs/test_multifs_auth.py @@ -8,7 +8,7 @@ from os.path import join as os_path_join # CapsHelper is subclassed from CephFSTestCase from tasks.cephfs.caps_helper import CapsHelper -from teuthology.orchestra.run import CommandFailedError +from teuthology.exceptions import CommandFailedError log = logging.getLogger(__name__) diff --git a/qa/tasks/cephfs/test_multimds_misc.py b/qa/tasks/cephfs/test_multimds_misc.py index 3c464e91d0a..2bb6257c7eb 100644 --- a/qa/tasks/cephfs/test_multimds_misc.py +++ b/qa/tasks/cephfs/test_multimds_misc.py @@ -2,7 +2,7 @@ import logging import errno from tasks.cephfs.cephfs_test_case import CephFSTestCase from teuthology.contextutil import safe_while -from teuthology.orchestra.run import CommandFailedError +from teuthology.exceptions import CommandFailedError log = logging.getLogger(__name__) diff --git a/qa/tasks/cephfs/test_recovery_pool.py b/qa/tasks/cephfs/test_recovery_pool.py index 9926b3670ca..5dd5960add1 100644 --- a/qa/tasks/cephfs/test_recovery_pool.py +++ b/qa/tasks/cephfs/test_recovery_pool.py @@ -6,7 +6,7 @@ import logging import traceback from collections import namedtuple -from teuthology.orchestra.run import CommandFailedError +from teuthology.exceptions import CommandFailedError from tasks.cephfs.cephfs_test_case import CephFSTestCase log = logging.getLogger(__name__) diff --git a/qa/tasks/cephfs/test_snapshots.py b/qa/tasks/cephfs/test_snapshots.py index fa4d9431fef..e651bb1c6b1 100644 --- a/qa/tasks/cephfs/test_snapshots.py +++ b/qa/tasks/cephfs/test_snapshots.py @@ -4,7 +4,8 @@ import signal from textwrap import dedent from tasks.cephfs.fuse_mount import FuseMount from tasks.cephfs.cephfs_test_case import CephFSTestCase -from teuthology.orchestra.run import CommandFailedError, Raw +from teuthology.orchestra.run import Raw +from teuthology.exceptions import CommandFailedError log = logging.getLogger(__name__) diff --git a/qa/tasks/cephfs/test_strays.py b/qa/tasks/cephfs/test_strays.py index f8313badd03..44ca0b013d8 100644 --- a/qa/tasks/cephfs/test_strays.py +++ b/qa/tasks/cephfs/test_strays.py @@ -5,7 +5,8 @@ from textwrap import dedent import datetime import gevent -from teuthology.orchestra.run import CommandFailedError, Raw +from teuthology.exceptions import CommandFailedError +from teuthology.orchestra.run import Raw from tasks.cephfs.cephfs_test_case import CephFSTestCase, for_teuthology log = logging.getLogger(__name__) diff --git a/qa/tasks/kclient.py b/qa/tasks/kclient.py index d7bc9fa835b..2749f01daee 100644 --- a/qa/tasks/kclient.py +++ b/qa/tasks/kclient.py @@ -5,7 +5,7 @@ import contextlib import logging from teuthology.misc import deep_merge -from teuthology.orchestra.run import CommandFailedError +from teuthology.exceptions import CommandFailedError from teuthology import misc from teuthology.contextutil import MaxWhileTries from tasks.cephfs.kernel_mount import KernelMount diff --git a/qa/tasks/mds_creation_failure.py b/qa/tasks/mds_creation_failure.py index 58314086c03..2ab8f70dd9d 100644 --- a/qa/tasks/mds_creation_failure.py +++ b/qa/tasks/mds_creation_failure.py @@ -5,7 +5,8 @@ import contextlib import time from tasks import ceph_manager from teuthology import misc -from teuthology.orchestra.run import CommandFailedError, Raw +from teuthology.exceptions import CommandFailedError +from teuthology.orchestra.run import Raw log = logging.getLogger(__name__) diff --git a/qa/tasks/vstart_runner.py b/qa/tasks/vstart_runner.py index eb85d5ab43a..916256495d4 100644 --- a/qa/tasks/vstart_runner.py +++ b/qa/tasks/vstart_runner.py @@ -56,7 +56,7 @@ from teuthology.orchestra.remote import Remote from teuthology.config import config as teuth_config from teuthology.contextutil import safe_while from teuthology.contextutil import MaxWhileTries -from teuthology.orchestra.run import CommandFailedError +from teuthology.exceptions import CommandFailedError try: import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) diff --git a/qa/tasks/workunit.py b/qa/tasks/workunit.py index 371d2a2dddb..6412c99bc04 100644 --- a/qa/tasks/workunit.py +++ b/qa/tasks/workunit.py @@ -12,7 +12,7 @@ from tasks.util.workunit import get_refspec_after_overrides from teuthology import misc from teuthology.config import config as teuth_config -from teuthology.orchestra.run import CommandFailedError +from teuthology.exceptions import CommandFailedError from teuthology.parallel import parallel from teuthology.orchestra import run -- 2.39.5