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:
parent
75fa095aa5
commit
f140d7905c
@ -77,30 +77,12 @@ def load_config(filename):
|
|||||||
'config file %s', filename)
|
'config file %s', filename)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
header = config.get('header', {})
|
version_value = int(config['header']['version'])
|
||||||
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)
|
|
||||||
except ValueError:
|
except ValueError:
|
||||||
# Be compatible: version string '0.10' is equivalent to file version 1
|
# Be compatible: version string '0.10' is equivalent to file version 1
|
||||||
if isinstance(version, str) and version == '0.10':
|
# This check is already done in the config schema so here just set the
|
||||||
version_value = 1
|
# right version
|
||||||
else:
|
version_value = 1
|
||||||
raise LoadConfigException('Unexpected version format', filename)
|
|
||||||
|
|
||||||
if version_value < __compatible_file_version__ or \
|
if version_value < __compatible_file_version__ or \
|
||||||
version_value > __file_version__:
|
version_value > __file_version__:
|
||||||
|
Loading…
Reference in New Issue
Block a user