Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions tools/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ def __init__(self, tgt, top_level_dirs=None, app_config=None):
top_level_dirs may be None (in this case, the constructor will not
search for a configuration file).
"""
config_errors = []
app_config_location = app_config
if app_config_location is None:
for directory in top_level_dirs or []:
Expand All @@ -399,8 +400,10 @@ def __init__(self, tgt, top_level_dirs=None, app_config=None):
self.app_config_data = json_file_to_dict(app_config_location) \
if app_config_location else {}
except ValueError as exc:
sys.stderr.write(str(exc) + "\n")
self.app_config_data = {}
config_errors.append(
ConfigException("Could not parse mbed app configuration from %s"
% app_config_location))

# Check the keys in the application configuration data
unknown_keys = set(self.app_config_data.keys()) - \
Expand Down Expand Up @@ -433,7 +436,7 @@ def __init__(self, tgt, top_level_dirs=None, app_config=None):

self._process_config_and_overrides(self.app_config_data, {}, "app",
"application")
self.config_errors = None
self.config_errors = config_errors

def add_config_files(self, flist):
"""Add configuration files
Expand Down Expand Up @@ -806,6 +809,7 @@ def load_resources(self, resources):
"""
# Update configuration files until added features creates no changes
prev_features = set()
self.validate_config()
while True:
# Add/update the configuration with any .json files found while
# scanning
Expand Down