parameters: (ctx, config)
docstring: Wait until a Ceph cluster is healthy.
docstring_summary: Wait until a Ceph cluster is healthy.
docstring_tokens: Wait until a Ceph cluster is healthy .
function: def is_healthy(ctx, config):
      """Wait until a Ceph cluster is healthy."""
      testdir = teuthology.get_testdir(ctx)
      ceph_admin = teuthology.get_first_mon(ctx, config)
      (remote,) = ctx.cluster.only(ceph_admin).remotes.keys()
      max_tries = 90  # 90 tries * 10 secs --> 15 minutes
      tries = 0
      while True:
          tries += 1
          if tries >= max_tries:
              msg = "ceph health was unable to get 'HEALTH_OK' after waiting 15 minutes"
              remote.run(
                  args=[
                      'cd',
                      '{tdir}'.format(tdir=testdir),
                      run.Raw('&&'),
                      'sudo', 'ceph',
                      'report',
                  ],
              )
              raise RuntimeError(msg)
  
          out = remote.sh(
              [
                  'cd',
                  '{tdir}'.format(tdir=testdir),
                  run.Raw('&&'),
                  'sudo', 'ceph',
                  'health',
              ],
              logger=log.getChild('health'),
          )
          log.info('Ceph health: %s', out.rstrip('\n'))
          if out.split(None, 1)[0] == 'HEALTH_OK':
              break
          time.sleep(10)
function_tokens: def is_healthy ( ctx , config ) : testdir = teuthology . get_testdir ( ctx ) ceph_admin = teuthology . get_first_mon ( ctx , config ) ( remote , ) = ctx . cluster . only ( ceph_admin ) . remotes . keys ( ) max_tries = 90 # 90 tries * 10 secs --> 15 minutes tries = 0 while True : tries += 1 if tries >= max_tries : msg = "ceph health was unable to get 'HEALTH_OK' after waiting 15 minutes" remote . run ( args = [ 'cd' , '{tdir}' . format ( tdir = testdir ) , run . Raw ( '&&' ) , 'sudo' , 'ceph' , 'report' , ] , ) raise RuntimeError ( msg ) out = remote . sh ( [ 'cd' , '{tdir}' . format ( tdir = testdir ) , run . Raw ( '&&' ) , 'sudo' , 'ceph' , 'health' , ] , logger = log . getChild ( 'health' ) , ) log . info ( 'Ceph health: %s' , out . rstrip ( '\n' ) ) if out . split ( None , 1 ) [ 0 ] == 'HEALTH_OK' : break time . sleep ( 10 )