]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
lock.py: not all virtual machines have a dedicated host 535/head
authorLoic Dachary <loic@dachary.org>
Sat, 13 Jun 2015 21:54:15 +0000 (21:54 +0000)
committerLoic Dachary <ldachary@redhat.com>
Wed, 1 Jul 2015 17:16:11 +0000 (19:16 +0200)
Gracefully handle the case where a virtual machine has no dedicated
host. It's the case for OpenStack.

Signed-off-by: Loic Dachary <loic@dachary.org>
teuthology/lock.py

index 5f681064008c529e426ad2a31cf4fcfa3672bd60..e371327d8303b3de9ff98df92152e26e5464fdbb 100644 (file)
@@ -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