config_tools: fix the UI issue that fail to overwrite scenario file

1. find default scenario file in board_type and generic_board director
 path.

Tracked-On: #6292
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
This commit is contained in:
Weiyi Feng 2021-10-19 15:56:57 +08:00 committed by wenlingz
parent 3450fbfe54
commit 2c5db9b7af

View File

@ -618,7 +618,10 @@ def create_setting():
template_file_name = 'shared'
src_file_name = os.path.join(current_app.config.get('DEFAULT_CONFIG_PATH'), 'generic_board', template_file_name + '.xml')
else: # load
src_file_name = os.path.join(current_app.config.get('DEFAULT_CONFIG_PATH'), board_type, default_name + '.xml')
src_file_name = os.path.join(current_app.config.get('DEFAULT_CONFIG_PATH'), board_type,
default_name + '.xml')
if not os.path.isfile(src_file_name):
src_file_name=os.path.join(current_app.config.get('DEFAULT_CONFIG_PATH'), 'generic_board', default_name + '.xml')
if os.path.isfile(src_file_name):
xsd_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'schema', 'config.xsd')