From: Zack Cerza Date: Tue, 19 Apr 2022 23:44:16 +0000 (-0600) Subject: task/ceph_ansible: Fix attribute handling X-Git-Tag: 1.2.0~180^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9ebb0ab96a5ae31e5807ddf5615921cf3f1f2888;p=teuthology.git task/ceph_ansible: Fix attribute handling ... in get_host_vars(). This had broken unit tests when a top-level "ceph_ansible" key is present in the teuthology config. Signed-off-by: Zack Cerza --- diff --git a/teuthology/task/ceph_ansible.py b/teuthology/task/ceph_ansible.py index a91403f79..18321d9e1 100644 --- a/teuthology/task/ceph_ansible.py +++ b/teuthology/task/ceph_ansible.py @@ -296,8 +296,11 @@ class CephAnsible(Task): roles = self.ctx.cluster.remotes[remote] dev_needed = len([role for role in roles if role.startswith('osd')]) - if teuth_config.get('ceph_ansible') and \ - self.ctx.machine_type in teuth_config['ceph_ansible']['has_lvm_scratch_disks']: + if ( + teuth_config.get('ceph_ansible') and + hasattr(self.ctx, "machine_type") and + self.ctx.machine_type in teuth_config['ceph_ansible']['has_lvm_scratch_disks'] + ): devices = get_file(remote, "/scratch_devs").decode().split() vols = []