]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/ceph_objectstore_tool.py: use str.startswit
authorKefu Chai <kchai@redhat.com>
Wed, 8 Apr 2020 04:32:54 +0000 (12:32 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 14 Jun 2020 08:34:51 +0000 (16:34 +0800)
in Python3, string module does not offer `string.find()` anymore, let's
use `str.find()` method instead.

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 77ec9ce88df54b7758e56eeef1b3cf3f14952513)

Conflicts:
qa/tasks/ceph_objectstore_tool.py: trivial resolution

qa/tasks/ceph_objectstore_tool.py

index 641981ebd36e4373f67f8d6d86e2a96f6b06e7cc..8636fdb6f3f035e1bac0ae5f5753eebb26d8630a 100644 (file)
@@ -10,8 +10,6 @@ from teuthology import misc as teuthology
 import time
 import os
 import six
-import string
-from teuthology.orchestra import run
 import sys
 import tempfile
 import json
@@ -288,7 +286,7 @@ def test_objectstore(ctx, config, cli_remote, REP_POOL, REP_NAME, ec=False):
         log.debug(remote)
         log.debug(osds.remotes[remote])
         for role in osds.remotes[remote]:
-            if string.find(role, "osd.") != 0:
+            if not role.startswith("osd."):
                 continue
             osdid = int(role.split('.')[1])
             log.info("process osd.{id} on {remote}".
@@ -325,7 +323,7 @@ def test_objectstore(ctx, config, cli_remote, REP_POOL, REP_NAME, ec=False):
 
             for remote in osds.remotes.keys():
                 for role in osds.remotes[remote]:
-                    if string.find(role, "osd.") != 0:
+                    if not role.startswith("osd."):
                         continue
                     osdid = int(role.split('.')[1])
                     if osdid not in pgs:
@@ -415,7 +413,7 @@ def test_objectstore(ctx, config, cli_remote, REP_POOL, REP_NAME, ec=False):
 
         for remote in osds.remotes.keys():
             for role in osds.remotes[remote]:
-                if string.find(role, "osd.") != 0:
+                if not role.startswith("osd."):
                     continue
                 osdid = int(role.split('.')[1])
                 if osdid not in pgs:
@@ -500,7 +498,7 @@ def test_objectstore(ctx, config, cli_remote, REP_POOL, REP_NAME, ec=False):
     log.info("Test pg info")
     for remote in osds.remotes.keys():
         for role in osds.remotes[remote]:
-            if string.find(role, "osd.") != 0:
+            if not role.startswith("osd."):
                 continue
             osdid = int(role.split('.')[1])
             if osdid not in pgs:
@@ -523,7 +521,7 @@ def test_objectstore(ctx, config, cli_remote, REP_POOL, REP_NAME, ec=False):
     log.info("Test pg logging")
     for remote in osds.remotes.keys():
         for role in osds.remotes[remote]:
-            if string.find(role, "osd.") != 0:
+            if not role.startswith("osd."):
                 continue
             osdid = int(role.split('.')[1])
             if osdid not in pgs:
@@ -554,7 +552,7 @@ def test_objectstore(ctx, config, cli_remote, REP_POOL, REP_NAME, ec=False):
     EXP_ERRORS = 0
     for remote in osds.remotes.keys():
         for role in osds.remotes[remote]:
-            if string.find(role, "osd.") != 0:
+            if not role.startswith("osd."):
                 continue
             osdid = int(role.split('.')[1])
             if osdid not in pgs:
@@ -580,7 +578,7 @@ def test_objectstore(ctx, config, cli_remote, REP_POOL, REP_NAME, ec=False):
     RM_ERRORS = 0
     for remote in osds.remotes.keys():
         for role in osds.remotes[remote]:
-            if string.find(role, "osd.") != 0:
+            if not role.startswith("osd."):
                 continue
             osdid = int(role.split('.')[1])
             if osdid not in pgs:
@@ -605,7 +603,7 @@ def test_objectstore(ctx, config, cli_remote, REP_POOL, REP_NAME, ec=False):
 
         for remote in osds.remotes.keys():
             for role in osds.remotes[remote]:
-                if string.find(role, "osd.") != 0:
+                if not role.startswith("osd."):
                     continue
                 osdid = int(role.split('.')[1])
                 if osdid not in pgs: