config: includehandler: remove other checks that are no longer needed

Using the jsonschema module makes some checks in the includehandler
redundant and can be removed. This patch does this.

Signed-off-by: Claudius Heine <ch@denx.de>
This commit is contained in:
Claudius Heine 2017-10-13 12:20:06 +02:00 committed by Daniel Wagner
parent 75fa095aa5
commit f140d7905c

View File

@ -77,30 +77,12 @@ def load_config(filename):
'config file %s', filename)
try:
header = config.get('header', {})
except AttributeError:
raise LoadConfigException('Config does not contain a dictionary',
filename)
if not header:
raise LoadConfigException('Header missing or empty', filename)
try:
version = header.get('version', None)
except AttributeError:
raise LoadConfigException('Header is not a dictionary', filename)
if not version:
raise LoadConfigException('Version missing or empty', filename)
try:
version_value = int(version)
version_value = int(config['header']['version'])
except ValueError:
# Be compatible: version string '0.10' is equivalent to file version 1
if isinstance(version, str) and version == '0.10':
version_value = 1
else:
raise LoadConfigException('Unexpected version format', filename)
# This check is already done in the config schema so here just set the
# right version
version_value = 1
if version_value < __compatible_file_version__ or \
version_value > __file_version__: