From: Nathan Cutler Date: Tue, 22 Oct 2019 14:45:04 +0000 (+0200) Subject: qa/tasks/ceph.py: fail test if osd devices not found X-Git-Tag: v16.1.0~2790^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F31055%2Fhead;p=ceph.git qa/tasks/ceph.py: fail test if osd devices not found Fixes: https://tracker.ceph.com/issues/42357 Signed-off-by: Nathan Cutler --- diff --git a/qa/tasks/ceph.py b/qa/tasks/ceph.py index 8db6e8c84ffe9..4bb5c94a625e2 100644 --- a/qa/tasks/ceph.py +++ b/qa/tasks/ceph.py @@ -598,16 +598,17 @@ def cluster(ctx, config): osds = ctx.cluster.only(teuthology.is_type('osd', cluster_name)) for remote, roles_for_host in osds.remotes.items(): devs = teuthology.get_scratch_devices(remote) - roles_to_devs = {} - if config.get('fs'): - log.info('fs option selected, checking for "scratch" (osd) devs') - log.info('found "scratch" (osd) devs: {}'.format(devs)) - roles_to_devs = assign_devs( - teuthology.cluster_roles_of_type(roles_for_host, 'osd', cluster_name), devs - ) - devs_to_clean[remote] = [] + roles_to_devs = assign_devs( + teuthology.cluster_roles_of_type(roles_for_host, 'osd', cluster_name), devs + ) + devs_to_clean[remote] = [] log.info('osd dev map: {}'.format(roles_to_devs)) + assert roles_to_devs, \ + "remote {} has osd roles, but no osd devices were specified!".format(remote.hostname) remote_to_roles_to_devs[remote] = roles_to_devs + log.info("remote_to_roles_to_devs: {}".format(remote_to_roles_to_devs)) + for osd_role, dev_name in remote_to_roles_to_devs.items(): + assert dev_name, "{} has no associated device!".format(osd_role) log.info('Generating config...') remotes_and_roles = ctx.cluster.remotes.items()