From d3cc668cd365784a77528640c602a34fde2a3161 Mon Sep 17 00:00:00 2001 From: Nathan Cutler Date: Thu, 25 Oct 2018 17:37:52 +0200 Subject: [PATCH] teuthology-openstack: fix broken deployment 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 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 Signed-off-by: Nathan Cutler Conflicts: teuthology/openstack/__init__.py --- teuthology/openstack/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/teuthology/openstack/__init__.py b/teuthology/openstack/__init__.py index 3d7c2ef2a1..ed569c65ab 100644 --- a/teuthology/openstack/__init__.py +++ b/teuthology/openstack/__init__.py @@ -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']) -- 2.39.5