mirror of
https://github.com/ceph/ceph
synced 2025-04-01 00:26:47 +00:00
qa/tasks/ceph2: use safe_while
Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
parent
ad6bd514c8
commit
96e9b8bc29
@ -405,21 +405,21 @@ def ceph_mons(ctx, config):
|
|||||||
started=True,
|
started=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
while True:
|
with contextutil.safe_while(sleep=1, tries=180) as proceed:
|
||||||
log.info('Waiting for %d mons in monmap...' % (num_mons))
|
while proceed():
|
||||||
r = shell(
|
log.info('Waiting for %d mons in monmap...' % (num_mons))
|
||||||
ctx=ctx,
|
r = shell(
|
||||||
cluster_name=cluster_name,
|
ctx=ctx,
|
||||||
remote=remote,
|
cluster_name=cluster_name,
|
||||||
args=[
|
remote=remote,
|
||||||
'ceph', 'mon', 'dump', '-f', 'json',
|
args=[
|
||||||
],
|
'ceph', 'mon', 'dump', '-f', 'json',
|
||||||
stdout=StringIO(),
|
],
|
||||||
)
|
stdout=StringIO(),
|
||||||
j = json.loads(r.stdout.getvalue())
|
)
|
||||||
if len(j['mons']) == num_mons:
|
j = json.loads(r.stdout.getvalue())
|
||||||
break
|
if len(j['mons']) == num_mons:
|
||||||
time.sleep(1)
|
break
|
||||||
|
|
||||||
# refresh ceph.conf files for all mons + first mgr
|
# refresh ceph.conf files for all mons + first mgr
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user