]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
Fix for blank yaml.
authorSandon Van Ness <sandon@inktank.com>
Fri, 23 Aug 2013 17:36:37 +0000 (10:36 -0700)
committerSandon Van Ness <sandon@inktank.com>
Fri, 23 Aug 2013 17:38:13 +0000 (10:38 -0700)
As well as fix variabl variable naming.

teuthology/suite.py

index bc30e4f8fb65a048a549a3904494e58838aaaaf8..e8df8619e7c957fa32dbaf1c04a2183d0291d5c6 100644 (file)
@@ -449,6 +449,8 @@ def get_os_type(configs):
     for config in configs:
         yamlfile = config[2]
         y = yaml.safe_load(file(yamlfile))
+        if not y:
+            y = {}
         os_type = y.get('os_type')
         if os_type:
             return os_type
@@ -458,23 +460,29 @@ def get_exclude_arch(configs):
     for config in configs:
         yamlfile = config[2]
         y = yaml.safe_load(file(yamlfile))
-        os_type = y.get('exclude_arch')
-        if os_type:
-            return os_type
+        if not y:
+            y = {}
+        exclude_arch = y.get('exclude_arch')
+        if exclude_arch:
+            return exclude_arch
     return None
 
 def get_exclude_os_type(configs):
     for config in configs:
         yamlfile = config[2]
         y = yaml.safe_load(file(yamlfile))
-        os_type = y.get('exclude_os_type')
-        if os_type:
-            return os_type
+        if not y:
+            y = {}
+        exclude_os_type = y.get('exclude_os_type')
+        if exclude_os_type:
+            return exclude_os_type
     return None
 
 def get_machine_type(config):
     for yamlfile in config:
         y = yaml.safe_load(file(yamlfile))
+        if not y:
+            y = {}
         machine_type = y.get('machine_type')
         if machine_type:
             return machine_type