Fixed unitialized values when no global section was defined.
- Introduced by the date formats patch
This commit is contained in:
parent
31d0c7d87c
commit
c34ba533e6
|
|
@ -337,6 +337,7 @@ class CfgYamlReader(object):
|
||||||
# List of outputs
|
# List of outputs
|
||||||
outputs = []
|
outputs = []
|
||||||
version = None
|
version = None
|
||||||
|
globals_found = False
|
||||||
# Analize each section
|
# Analize each section
|
||||||
for k, v in data.items():
|
for k, v in data.items():
|
||||||
# logger.debug('{} {}'.format(k, v))
|
# logger.debug('{} {}'.format(k, v))
|
||||||
|
|
@ -346,6 +347,7 @@ class CfgYamlReader(object):
|
||||||
self._parse_preflight(v)
|
self._parse_preflight(v)
|
||||||
elif k == 'global':
|
elif k == 'global':
|
||||||
self._parse_global(v)
|
self._parse_global(v)
|
||||||
|
globals_found = True
|
||||||
elif k == 'import':
|
elif k == 'import':
|
||||||
outputs.extend(self._parse_import(v, fstream.name))
|
outputs.extend(self._parse_import(v, fstream.name))
|
||||||
elif k == 'variants':
|
elif k == 'variants':
|
||||||
|
|
@ -358,6 +360,9 @@ class CfgYamlReader(object):
|
||||||
config_error('Unknown section `{}` in config.'.format(k))
|
config_error('Unknown section `{}` in config.'.format(k))
|
||||||
if version is None:
|
if version is None:
|
||||||
config_error("YAML config needs `kibot.version`.")
|
config_error("YAML config needs `kibot.version`.")
|
||||||
|
# If no globals defined initialize them with default values
|
||||||
|
if not globals_found:
|
||||||
|
self._parse_global({})
|
||||||
# Solve the global variant
|
# Solve the global variant
|
||||||
if GS.global_variant:
|
if GS.global_variant:
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue