From: Loic Dachary Date: Sat, 13 Jun 2015 21:54:15 +0000 (+0000) Subject: lock.py: not all virtual machines have a dedicated host X-Git-Tag: 1.1.0~888^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=badde75b8806a6d25962ac1aaf9c02a9c5a068cc;p=teuthology.git lock.py: not all virtual machines have a dedicated host Gracefully handle the case where a virtual machine has no dedicated host. It's the case for OpenStack. Signed-off-by: Loic Dachary --- diff --git a/teuthology/lock.py b/teuthology/lock.py index 5f68106400..e371327d83 100644 --- a/teuthology/lock.py +++ b/teuthology/lock.py @@ -266,6 +266,9 @@ def main(ctx): for s in statuses: if not s.get('is_vm', False): continue + # with an OpenStack API, there is no host for a VM + if s['vm_host'] is None: + continue vm_host_name = s.get('vm_host', dict())['name'] if vm_host_name: s['vm_host'] = vm_host_name