From 6a58314d4627d106c5fd6df186e191c19a01f64b Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 19 Apr 2012 12:43:54 -0700 Subject: [PATCH] fix misc checks that wait for N osds to be up These all cut&pasted broken code, blah! --- teuthology/task/lost_unfound.py | 2 +- teuthology/task/object_source_down.py | 2 +- teuthology/task/osd_backfill.py | 2 +- teuthology/task/osd_recovery.py | 6 +++--- teuthology/task/peer.py | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/teuthology/task/lost_unfound.py b/teuthology/task/lost_unfound.py index 2cfc4eadc3411..09932e451a2d3 100644 --- a/teuthology/task/lost_unfound.py +++ b/teuthology/task/lost_unfound.py @@ -40,7 +40,7 @@ def task(ctx, config): logger=log.getChild('ceph_manager'), ) - while manager.get_osd_status()['up'] < 3: + while len(manager.get_osd_status()['up']) < 3: manager.sleep(10) manager.raw_cluster_cmd('tell', 'osd.0', 'flush_pg_stats') manager.raw_cluster_cmd('tell', 'osd.1', 'flush_pg_stats') diff --git a/teuthology/task/object_source_down.py b/teuthology/task/object_source_down.py index 89d812f7635b2..7c69f91bb14a8 100644 --- a/teuthology/task/object_source_down.py +++ b/teuthology/task/object_source_down.py @@ -41,7 +41,7 @@ def task(ctx, config): logger=log.getChild('ceph_manager'), ) - while manager.get_osd_status()['up'] < 3: + while len(manager.get_osd_status()['up']) < 3: manager.sleep(10) manager.wait_for_clean() diff --git a/teuthology/task/osd_backfill.py b/teuthology/task/osd_backfill.py index 7660142e2d471..008da1cd01319 100644 --- a/teuthology/task/osd_backfill.py +++ b/teuthology/task/osd_backfill.py @@ -45,7 +45,7 @@ def task(ctx, config): logger=log.getChild('ceph_manager'), ) - while manager.get_osd_status()['up'] < 3: + while len(manager.get_osd_status()['up']) < 3: manager.sleep(10) manager.raw_cluster_cmd('tell', 'osd.0', 'flush_pg_stats') manager.raw_cluster_cmd('tell', 'osd.1', 'flush_pg_stats') diff --git a/teuthology/task/osd_recovery.py b/teuthology/task/osd_recovery.py index 9b52521840dac..27596b39c994f 100644 --- a/teuthology/task/osd_recovery.py +++ b/teuthology/task/osd_recovery.py @@ -45,7 +45,7 @@ def task(ctx, config): logger=log.getChild('ceph_manager'), ) - while manager.get_osd_status()['up'] < 3: + while len(manager.get_osd_status()['up']) < 3: manager.sleep(10) manager.raw_cluster_cmd('tell', 'osd.0', 'flush_pg_stats') manager.raw_cluster_cmd('tell', 'osd.1', 'flush_pg_stats') @@ -81,9 +81,9 @@ def task(ctx, config): # revive divergent osd manager.revive_osd(2) - while manager.get_osd_status()['up'] < 3: + while len(manager.get_osd_status()['up']) < 3: log.info('waiting a bit...') - manager.sleep(2) + time.sleep(2) log.info('3 are up!') # cluster must recover diff --git a/teuthology/task/peer.py b/teuthology/task/peer.py index 78971daf0fa10..e0209f8303d00 100644 --- a/teuthology/task/peer.py +++ b/teuthology/task/peer.py @@ -41,7 +41,7 @@ def task(ctx, config): logger=log.getChild('ceph_manager'), ) - while manager.get_osd_status()['up'] < 3: + while len(manager.get_osd_status()['up']) < 3: manager.sleep(10) manager.raw_cluster_cmd('tell', 'osd.0', 'flush_pg_stats') manager.raw_cluster_cmd('tell', 'osd.1', 'flush_pg_stats') -- 2.39.5