]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Guard against ctx.config being unset or None
authorZack Cerza <zack@cerza.org>
Fri, 21 Feb 2014 15:43:33 +0000 (09:43 -0600)
committerZack Cerza <zack@cerza.org>
Fri, 21 Feb 2014 15:43:33 +0000 (09:43 -0600)
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
teuthology/lock.py

index 77b83f9b24d167961269dfb4a5bca763d045a41c..023669002bca8659af8a4012735dbbed7021cd2e 100644 (file)
@@ -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