]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/samba: drop python2 support
authorKefu Chai <kchai@redhat.com>
Sun, 19 Jul 2020 09:38:09 +0000 (17:38 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 22 Jul 2020 03:55:49 +0000 (11:55 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
qa/tasks/samba.py

index 1dd62d8624cf36ecd3d0ffde53a00a328acf977f..280f5342d3abdb5d88660e78199df711eb40776a 100644 (file)
@@ -3,11 +3,8 @@ Samba
 """
 import contextlib
 import logging
-import sys
 import time
 
-import six
-
 from teuthology import misc as teuthology
 from teuthology.orchestra import run
 from teuthology.orchestra.daemon import DaemonGroup
@@ -24,7 +21,7 @@ def get_sambas(ctx, roles):
     :param roles: roles for this test (extracted from yaml files)
     """
     for role in roles:
-        assert isinstance(role, six.string_types)
+        assert isinstance(role, str)
         PREFIX = 'samba.'
         assert role.startswith(PREFIX)
         id_ = role[len(PREFIX):]
@@ -188,17 +185,17 @@ def task(ctx, config):
         yield
     finally:
         log.info('Stopping smbd processes...')
-        exc_info = (None, None, None)
+        exc = None
         for d in ctx.daemons.iter_daemons_of_role('smbd'):
             try:
                 d.stop()
             except (run.CommandFailedError,
                     run.CommandCrashedError,
-                    run.ConnectionLostError):
-                exc_info = sys.exc_info()
+                    run.ConnectionLostError) as e:
+                exc = e
                 log.exception('Saw exception from %s.%s', d.role, d.id_)
-        if exc_info != (None, None, None):
-            six.reraise(exc_info[0], exc_info[1], exc_info[2])
+        if exc is not None:
+            raise exc
 
         for id_, remote in samba_servers:
             remote.run(