"""
json_fp = StringIO()
testdir = teuthology.get_testdir(ctx)
- remote.run(
- args=[
- 'sudo',
- '{tdir}/adjust-ulimits'.format(tdir=testdir),
- 'ceph-coverage',
- '{tdir}/archive/coverage'.format(tdir=testdir),
- 'ceph',
- '--admin-daemon', socket_path,
- command,
- ] + args,
- stdout=json_fp,
- )
+ max_tries = 60
+ while True:
+ proc = remote.run(
+ args=[
+ 'sudo',
+ '{tdir}/adjust-ulimits'.format(tdir=testdir),
+ 'ceph-coverage',
+ '{tdir}/archive/coverage'.format(tdir=testdir),
+ 'ceph',
+ '--admin-daemon', socket_path,
+ command,
+ ] + args,
+ stdout=json_fp,
+ )
+ if proc.exitstatus == 0:
+ break
+ assert max_tries > 0
+ max_tries -= 1
+ log.info('ceph cli returned an error, command not registered yet? sleeping and retrying ...')
+ time.sleep(1)
out = json_fp.getvalue()
json_fp.close()
log.debug('admin socket command %s returned %s', command, out)