]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Simplify create_if_vm's downburst config logic
authorZack Cerza <zack@cerza.org>
Tue, 11 Feb 2014 19:52:23 +0000 (13:52 -0600)
committerZack Cerza <zack@cerza.org>
Thu, 20 Feb 2014 23:46:08 +0000 (17:46 -0600)
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
teuthology/lock.py

index ada71a7a8b632825c2a740fb73d1aa1275669367..77b83f9b24d167961269dfb4a5bca763d045a41c 100644 (file)
@@ -452,15 +452,9 @@ def create_if_vm(ctx, machine_name):
                 if lcnfg.keys() == ['downburst']:
                     lcnfg = lcnfg['downburst']
         except (TypeError, AttributeError):
-            try:
-                lcnfg = {}
-                for tdict in ctx.config['downburst']:
-                    for key in tdict:
-                        lcnfg[key] = tdict[key]
-            except (KeyError, AttributeError):
-                lcnfg = {}
+            lcnfg = ctx.config.get('downburst', dict())
         except IOError:
-            print "Error reading %s" % lfile 
+            print "Error reading %s" % lfile
             return False
 
         distro = lcnfg.get('distro', os_type.lower())