config_tools: create json schema path

Create a temporary directroy to write JSON Schema while build packages.

Tracked-On: #7459
Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com>
This commit is contained in:
Yuanyuan Zhao 2022-05-12 15:03:24 +08:00 committed by acrnsi-robot
parent d233a0d30f
commit db53f21404

View File

@ -390,6 +390,7 @@ def main():
schema_file = config_tools / 'schema' / 'sliced.xsd'
json_schema_file = config_tools / 'configurator' / 'packages' / 'configurator' / 'build' / 'assets' / 'scenario.json'
json_schema_file.parent.mkdir(parents=True, exist_ok=True)
# Convert XSD to JSON Schema
# Todo: turn off it
@ -401,7 +402,8 @@ def main():
json_schema = json.dumps(json_schema, indent='\t')
# Write file and print successful message
open(json_schema_file, 'w', encoding='utf-8').write(json_schema)
with open(json_schema_file, 'w', encoding='utf-8') as f:
f.write(json_schema)
print("File %s Convert Success. JSON Schema Write To: %s" % (repr(schema_file), repr(json_schema_file)))