From cfb7b948eaa179d21efb628a096c21094397de28 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Fri, 21 Feb 2014 09:43:33 -0600 Subject: [PATCH] Guard against ctx.config being unset or None Signed-off-by: Zack Cerza --- teuthology/lock.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/teuthology/lock.py b/teuthology/lock.py index 77b83f9b24..023669002b 100644 --- a/teuthology/lock.py +++ b/teuthology/lock.py @@ -452,7 +452,10 @@ def create_if_vm(ctx, machine_name): if lcnfg.keys() == ['downburst']: lcnfg = lcnfg['downburst'] except (TypeError, AttributeError): - lcnfg = ctx.config.get('downburst', dict()) + if hasattr(ctx, 'config') and ctx.config is not None: + lcnfg = ctx.config.get('downburst', dict()) + else: + lcnfg = {} except IOError: print "Error reading %s" % lfile return False -- 2.39.5