]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
teuthology-openstack: fix broken deployment
authorNathan Cutler <ncutler@suse.com>
Thu, 25 Oct 2018 15:37:52 +0000 (17:37 +0200)
committerKyr Shatskyy <kyrylo.shatskyy@suse.com>
Mon, 14 Oct 2019 15:32:08 +0000 (17:32 +0200)
d6be711301fe7331acd428ab261ea648ef86305f broke the t-o deployment,
causing it to fail with the following Traceback:

2018-10-25 17:23:46,078.078 DEBUG:teuthology.misc:No server with a name
or ID of 'teuth-jschmid' exists.
Traceback (most recent call last):
  File "/home/jxs/projects/teuthology/teuthology/v/bin/teuthology-openstack", line 11, in <module>
    load_entry_point('teuthology', 'console_scripts', 'teuthology-openstack')()
  File "/home/jxs/projects/teuthology/teuthology/scripts/openstack.py", line 7, in main
    sys.exit(teuthology.openstack.main(parse_args(argv), argv))
  File "/home/jxs/projects/teuthology/teuthology/teuthology/openstack/__init__.py", line 1310, in main
    return TeuthologyOpenStack(ctx, teuth_config, argv).main()
  File "/home/jxs/projects/teuthology/teuthology/teuthology/openstack/__init__.py", line 704, in main
    self.setup()
  File "/home/jxs/projects/teuthology/teuthology/teuthology/openstack/__init__.py", line 890, in setup
    self.instance = OpenStackInstance(self.server_name())
  File "/home/jxs/projects/teuthology/teuthology/teuthology/openstack/__init__.py", line 82, in __init__
    if self.info['status'] == 'ERROR':
TypeError: 'NoneType' object has no attribute '__getitem__'

Signed-off-by: Joshua Schmid <jschmid@suse.com>
Signed-off-by: Nathan Cutler <ncutler@suse.com>
Conflicts:
teuthology/openstack/__init__.py

teuthology/openstack/__init__.py

index 3d7c2ef2a1acd9f388186cf3c3012c9327300e4e..ed569c65ab1d8132515c517b82ce7b48d23fc178 100644 (file)
@@ -82,7 +82,7 @@ class OpenStackInstance(object):
             self.set_info()
         else:
             self.info = dict(map(lambda (k,v): (k.lower(), v), info.items()))
-        if self.info['status'] == 'ERROR':
+        if isinstance(self.info, dict) and self.info.get('status', '') == 'ERROR':
             errmsg = 'VM creation failed'
             if 'message' in self.info:
                 errmsg = '{}: {}'.format(errmsg, self.info['message'])