From dde617fa499517be11257bfeb825af76465e3bd5 Mon Sep 17 00:00:00 2001 From: Kunhui-Li Date: Thu, 4 Nov 2021 15:18:44 +0800 Subject: [PATCH] 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 --- misc/config_tools/config_app/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/misc/config_tools/config_app/views.py b/misc/config_tools/config_app/views.py index 41e590113..81a46335c 100644 --- a/misc/config_tools/config_app/views.py +++ b/misc/config_tools/config_app/views.py @@ -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'))