]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
teuthology: pass integer as "tries" to safe_while() 1445/head
authorKefu Chai <kchai@redhat.com>
Mon, 13 Apr 2020 04:43:35 +0000 (12:43 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 13 Apr 2020 04:45:20 +0000 (12:45 +0800)
in Python3, `a / b` could return a float, and `safe_while()` uses
`itertools.islice()` under the hood, where `stop` should be None or an
integer. so let's use `a // b` instead.

Signed-off-by: Kefu Chai <kchai@redhat.com>
teuthology/misc.py
teuthology/orchestra/run.py

index 6a6cde0bfe212f01f64da73232788eeb567c9d29..45ddcbd6014c9c27ad81cb31b950217a129c8dd1 100644 (file)
@@ -863,7 +863,7 @@ def wait_until_healthy(ctx, remote, ceph_cluster='ceph', use_sudo=False):
             'ceph-coverage',
             '{tdir}/archive/coverage'.format(tdir=testdir)]
     args.extend(cmd)
-    with safe_while(tries=(900 / 6), action="wait_until_healthy") as proceed:
+    with safe_while(tries=(900 // 6), action="wait_until_healthy") as proceed:
         while proceed():
             out = remote.sh(args, logger=log.getChild('health'))
             log.debug('Ceph health: %s', out.rstrip('\n'))
index 059c94688b1e99d54e8b67b4ebb4cfd230ec928b..70128ce6225c21c9e43efbd3b01017c4b6f8ad34 100644 (file)
@@ -485,7 +485,7 @@ def wait(processes, timeout=None):
     if timeout:
         log.info("waiting for %d", timeout)
     if timeout and timeout > 0:
-        with safe_while(tries=(timeout / 6)) as check_time:
+        with safe_while(tries=(timeout // 6)) as check_time:
             not_ready = list(processes)
             while len(not_ready) > 0:
                 check_time()