From badde75b8806a6d25962ac1aaf9c02a9c5a068cc Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Sat, 13 Jun 2015 21:54:15 +0000 Subject: [PATCH] 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 --- teuthology/lock.py | 3 +++ 1 file changed, 3 insertions(+) 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 -- 2.39.5