From: Sandon Van Ness Date: Fri, 23 Aug 2013 17:36:37 +0000 (-0700) Subject: Fix for blank yaml. X-Git-Tag: 1.1.0~1941 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c107adeb68fe9f7510fc02359e949f871236ca39;p=teuthology.git Fix for blank yaml. As well as fix variabl variable naming. --- diff --git a/teuthology/suite.py b/teuthology/suite.py index bc30e4f8f..e8df8619e 100644 --- a/teuthology/suite.py +++ b/teuthology/suite.py @@ -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