config_tools: fix UI issue don't expand the default value in xml file

when we click the "Import XML" button to import the scenario xml file, then
click the "Export XML" to export the xml files, we will find some errors because
UI don't show the default value set in schema.

As a workaround, we call default_populator.py in UI to expand the default value
in the scenario XML file to fix the issue.

Tracked-On: #6292
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
This commit is contained in:
Kunhui-Li 2021-11-04 15:18:44 +08:00 committed by wenlingz
parent 83a938bae6
commit dde617fa49
1 changed files with 2 additions and 0 deletions

View File

@ -900,6 +900,8 @@ def upload_scenario():
+ datetime.now().strftime('%Y%m%d%H%M%S')
rename = True
xsd_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'schema', 'config.xsd')
default_populator.main(xsd_path, tmp_scenario_file, tmp_scenario_file)
os.rename(tmp_scenario_file, os.path.join(current_app.config.get('CONFIG_PATH'),
board_type, new_scenario_name + '.xml'))