lf_check.py : meta.txt created with test_tag information

Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
This commit is contained in:
Chuck SmileyRekiere
2021-08-20 17:26:15 -06:00
parent 15b9cb916a
commit ff81faaab5

View File

@@ -1035,13 +1035,17 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url)
stdout_log_fd.close()
if meta_data_path != "":
meta_data = open(meta_data_path,'w')
meta_data.write('$Generated by Candela Technologies LANforge network testing tool \n')
meta_data.write('$meta.txt \n')
meta_data.write("file {path} \n".format(path=meta_data_path))
meta_data.write('$ Generated by Candela Technologies LANforge network testing tool\n')
meta_data.write('$ meta.txt file location\n')
meta_data.write("file {path}\n".format(path=meta_data_path))
meta_data.write('$ LANforge command\n')
meta_data.write("command {command}\n".format(command=command))
# split command at test-tag , at rest of string once at the actual test-tag value
test_tag = command.split('test-tag',maxsplit=1)[-1].split(maxsplit=1)[0]
meta_data.write("command: {command}".format(command=command))
meta_data.write("test_tag {test_tag} \n".format(test_tag=test_tag))
test_tag = command.split('test_tag',maxsplit=1)[-1].split(maxsplit=1)[0]
test_tag = test_tag.replace("'","")
meta_data.write('$ LANforge command\n')
meta_data.write("test_tag {test_tag}\n".format(test_tag=test_tag))
meta_data.write('$ LANforge Information\n')
meta_data.close()