From 4e145658a7d422c57fc3c980b9fff6e211c7c68a Mon Sep 17 00:00:00 2001 From: Vasu Kulkarni Date: Sat, 12 Mar 2016 02:15:39 -0500 Subject: [PATCH] Fix review comments Signed-off-by: Vasu Kulkarni --- clusters/fixed-1.yaml | 6 ++++-- tasks/ceph_deploy.py | 20 +++++++------------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/clusters/fixed-1.yaml b/clusters/fixed-1.yaml index 4259c313dac2f..3768607330822 100644 --- a/clusters/fixed-1.yaml +++ b/clusters/fixed-1.yaml @@ -2,7 +2,9 @@ overrides: ceph-deploy: conf: global: - mon pg warn min per osd: 1 - osd pool default size: 1 + osd pool default size: 2 + osd crush chooseleaf type: 0 + osd pool default pg num: 128 + osd pool default pgp num: 128 roles: - [mon.a, osd.0, osd.1, osd.2, client.0] diff --git a/tasks/ceph_deploy.py b/tasks/ceph_deploy.py index b82ed84111381..8b8badc77cee2 100644 --- a/tasks/ceph_deploy.py +++ b/tasks/ceph_deploy.py @@ -557,19 +557,12 @@ def cli_test(ctx, config): out = r.stdout.getvalue() log.info('Ceph health: %s', out.rstrip('\n')) log.info("Waiting for cluster to become healthy") - retry = 1 - while (out.split(None, 1)[0] != 'HEALTH_OK') and (retry <= 6): - r = remote.run(args=['sudo', 'ceph', 'health'], stdout=StringIO()) - log.info('Retry: %d Ceph health: %s', retry, out.rstrip('\n')) - time.sleep(10) - retry += 1 - if (retry > 6): - raise RuntimeError( - "Failed to reach HEALTH_OK state after {r} retries".format( - r=retry)) - else: - log.info('All ceph-deploy cli tests passed') - # test rgw cli + with contextutil.safe_while(sleep=10, tries=6, + action='check health') as proceed: + while proceed(): + r = remote.run(args=['sudo', 'ceph', 'health'], stdout=StringIO()) + if (out.split(None,1)[0] == 'HEALTH_OK'): + break rgw_install = 'install {branch} --rgw {node}'.format( branch=test_branch, node=nodename, @@ -577,6 +570,7 @@ def cli_test(ctx, config): rgw_create = 'rgw create ' + nodename execute_cdeploy(admin, rgw_install, path) execute_cdeploy(admin, rgw_create, path) + log.info('All ceph-deploy cli tests passed') try: yield finally: -- 2.39.5