Compare commits

..

No commits in common. "7997c17932b6012629808b265326803d2833a3df" and "7a85ff088a0bdea592c8b4bd1a932648d55b4a5f" have entirely different histories.

2 changed files with 3 additions and 17 deletions

1
cube/.gitignore vendored

@ -1 +0,0 @@
output/*

@ -22,26 +22,14 @@ file_path = 'create_nicsensor.py'
absolute_path = os.path.abspath(file_path) absolute_path = os.path.abspath(file_path)
workspace_path = get_content_before_substring(absolute_path, "src") workspace_path = get_content_before_substring(absolute_path, "src")
board_feature_path = os.path.join(workspace_path, "data", "BoardFeature.json") model_path = "data\\"
hw_topo_path = os.path.join(workspace_path, "data", "ServerHwTopo.json") board_feature_path = workspace_path + model_path + "BoardFeature.json"
output_path = os.path.join(workspace_path, "output", "nicsensor.sh") hw_topo_path = workspace_path + model_path + "ServerHwTopo.json"
dbg_print("info", "====== Pre Init ======") dbg_print("info", "====== Pre Init ======")
dbg_print("info", f"workspace_path={workspace_path}") dbg_print("info", f"workspace_path={workspace_path}")
dbg_print("info", f"board_feature_path={board_feature_path}") dbg_print("info", f"board_feature_path={board_feature_path}")
dbg_print("info", f"hw_topo_path={hw_topo_path}") dbg_print("info", f"hw_topo_path={hw_topo_path}")
dbg_print("info", f"output_path={output_path}")
def init_output_file():
dbg_print("info", "====== Init output file ======")
# if file exist , remove it
# create output file
try:
with open(output_path, 'w', encoding='utf-8') as file:
content = "#!/bin/sh"
file.write(content)
except Exception as e:
print(f"写入文件时出现错误: {e}")
def process_hw_topo(): def process_hw_topo():
dbg_print("info", "====== Process Server Hw Topo ======") dbg_print("info", "====== Process Server Hw Topo ======")
@ -112,5 +100,4 @@ def process_hw_topo():
# ===================================================== # =====================================================
# Start execute script # Start execute script
# ===================================================== # =====================================================
init_output_file()
process_hw_topo() process_hw_topo()