mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-10-31 18:58:01 +00:00
Add a try, except condition around the test_tag variable to support older lanforge versions
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
This commit is contained in:
@@ -313,7 +313,10 @@ class GhostRequest:
|
||||
df = csvreader.read_csv(file=target_file, sep='\t')
|
||||
test_rig = csvreader.get_column(df, 'test-rig')[0]
|
||||
test_id = csvreader.get_column(df, 'test-id')[0]
|
||||
test_tag[test_id] = (csvreader.get_column(df, 'test-tag')[0])
|
||||
try:
|
||||
test_tag[test_id] = (csvreader.get_column(df, 'test-tag')[0])
|
||||
except:
|
||||
notesttag = True
|
||||
pass_fail = Counter(csvreader.get_column(df, 'pass/fail'))
|
||||
test_pass_fail.append(pass_fail)
|
||||
dut_hw = csvreader.get_column(df, 'dut-hw-version')[0]
|
||||
@@ -330,8 +333,14 @@ class GhostRequest:
|
||||
subtest_pass_fail_list['PASS'] = subtest_pass_total
|
||||
subtest_pass_fail_list['FAIL'] = subtest_fail_total
|
||||
subtest_pass_fail.append(subtest_pass_fail_list)
|
||||
duts = [dut_serial, dut_hw, dut_sw, dut_model, test_rig, test_tag]
|
||||
if notesttag:
|
||||
duts = [dut_serial, dut_hw, dut_sw, dut_model, test_rig, test_tag]
|
||||
else:
|
||||
duts = [dut_serial, dut_hw, dut_sw, dut_model, test_rig]
|
||||
times_append = csvreader.get_column(df, 'Date')
|
||||
if len(times_append) == 0:
|
||||
print(LookupError("%s/kpi.csv has no time points" % target_folder))
|
||||
break
|
||||
for target_time in times_append:
|
||||
times.append(float(target_time) / 1000)
|
||||
if pass_fail['PASS'] + pass_fail['FAIL'] > 0:
|
||||
@@ -415,6 +424,8 @@ class GhostRequest:
|
||||
failuredict = dict()
|
||||
failuredict[target_folder] = ['Failure']
|
||||
webpagesandpdfs.append(failuredict)
|
||||
if len(times) == 0:
|
||||
return ArithmeticError("There are no datapoints in any folders passed into Ghost")
|
||||
|
||||
|
||||
test_pass_fail_results = sum((Counter(test) for test in test_pass_fail), Counter())
|
||||
|
||||
@@ -21,7 +21,6 @@ import json
|
||||
import influxdb_client
|
||||
from influxdb_client.client.write_api import SYNCHRONOUS
|
||||
import datetime
|
||||
#from LANforge.lfcli_base import LFCliBase
|
||||
import time
|
||||
|
||||
class RecordInflux:
|
||||
|
||||
Reference in New Issue
Block a user