From 8823eb2465136e18f36bd295d97047b43c98c2fc Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Thu, 17 Mar 2016 18:07:51 -0400 Subject: [PATCH] config: config object: null sets prop to default value Signed-off-by: Philippe Proulx --- barectf/config.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/barectf/config.py b/barectf/config.py index ce71260..794492e 100644 --- a/barectf/config.py +++ b/barectf/config.py @@ -2361,11 +2361,16 @@ class _YamlConfigParser: return version def _get_prefix(self, root): + def_prefix = 'barectf_' + if 'prefix' not in root: - return 'barectf_' + return def_prefix prefix_node = root['prefix'] + if prefix_node is None: + return def_prefix + if not _is_str_prop(prefix_node): raise ConfigError('"prefix" property (configuration) must be a string') -- 2.34.1