Skip to content

Commit ab87940

Browse files
ttzengwenlingz
authored andcommitted
acrn-config: create temporary scenario file folder if it doesn't exist
This commit creates the folder for hosting the temporary scenario .xml files if the folder doesn't exist to avoid the FileNotFound python exception. Tracked-On: #4522 Signed-off-by: Tonny Tzeng <tonny.tzeng@intel.com>
1 parent 9b6fa69 commit ab87940

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

misc/acrn-config/config_app/views.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,9 @@ def upload_scenario():
527527
tmp_scenario_name = 'tmp_' + scenario_file_name + '.xml'
528528
tmp_scenario_file = os.path.join(current_app.config.get('CONFIG_PATH'), board_type,
529529
'user_defined', tmp_scenario_name)
530+
tmp_scenario_folder = os.path.dirname(tmp_scenario_file)
531+
if not os.path.exists(tmp_scenario_folder):
532+
os.makedirs(tmp_scenario_folder)
530533
if os.path.isfile(tmp_scenario_file):
531534
os.remove(tmp_scenario_file)
532535

0 commit comments

Comments
 (0)