config_tools: save board xml when loading from config tool UI

save the board xml into misc/config_tools/data/[board]/ when
loading a new board from config tool UI.

Tracked-On: #6104
Signed-off-by: Kunhui Li <kunhuix.li@intel.com>
This commit is contained in:
Kunhui Li 2021-05-27 04:22:45 -04:00 committed by wenlingz
parent f6a3f5b0d0
commit 033f458d85

View File

@ -676,9 +676,11 @@ def upload_board_info():
if board_type not in board_type_list:
info = board_type
os.makedirs(os.path.join(config_path, board_type))
copyfile(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'res', filename),
os.path.join(os.path.join(config_path, board_type), filename))
for generic_name in os.listdir(os.path.join(config_path, 'generic_board')):
generic_file = os.path.join(config_path, 'generic_board', generic_name)
if os.path.isfile(generic_file):
if os.path.isfile(generic_file) and generic_name not in ['generic_board.xml']:
new_file = os.path.join(config_path, board_type, generic_name)
copyfile(generic_file, new_file)
xml_config = XmlConfig(os.path.join(current_app.config.get('CONFIG_PATH'),