mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-02 03:37:55 +00:00
create_chamberview: Fix obtuse logic which breaks without clear warnings
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
This commit is contained in:
@@ -90,45 +90,43 @@ class CreateChamberview(cv):
|
|||||||
Freq = "-1"
|
Freq = "-1"
|
||||||
VLAN = ""
|
VLAN = ""
|
||||||
|
|
||||||
for i in range(len(line)):
|
for item in line:
|
||||||
if " " in line[i][0]:
|
if " " in item[0]:
|
||||||
line[i][0] = (re.split(' ', line[i][0]))
|
item[0] = (re.split(' ', item[0]))
|
||||||
elif "," in line[i][0]:
|
elif "," in item[0]:
|
||||||
line[i][0] = (re.split(',', line[i][0]))
|
item[0] = (re.split(',', item[0]))
|
||||||
elif ", " in line[i][0]:
|
elif ", " in item[0]:
|
||||||
line[i][0] = (re.split(',', line[i][0]))
|
item[0] = (re.split(',', item[0]))
|
||||||
elif " ," in line[i][0]:
|
elif " ," in item[0]:
|
||||||
line[i][0] = (re.split(',', line[i][0]))
|
item[0] = (re.split(',', item[0]))
|
||||||
else:
|
else:
|
||||||
print("Wrong arguments entered !")
|
print("Wrong arguments entered !")
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
print("creating %s scenario" % scenario_name)
|
print("creating %s scenario" % scenario_name)
|
||||||
for j in range(len(line[i][0])):
|
for sub_item in item[0]:
|
||||||
line[i][0][j] = line[i][0][j].split("=")
|
sub_item = sub_item.split("=")
|
||||||
for k in range(len(line[i][0][j])):
|
if sub_item[0] == "Resource" or str(
|
||||||
name = line[i][0][j][k]
|
sub_item[0]) == "Res" or sub_item[0] == "R":
|
||||||
if str(name) == "Resource" or str(
|
Resource = sub_item[1]
|
||||||
name) == "Res" or str(name) == "R":
|
elif sub_item[0] == "Profile" or sub_item[0] == "Prof" or sub_item[0] == "P":
|
||||||
Resource = line[i][0][j][k + 1]
|
Profile = sub_item[1]
|
||||||
elif str(name) == "Profile" or str(name) == "Prof" or str(name) == "P":
|
elif sub_item[0] == "Amount" or sub_item[0] == "Sta" or sub_item[0] == "A":
|
||||||
Profile = line[i][0][j][k + 1]
|
Amount = sub_item[1]
|
||||||
elif str(name) == "Amount" or str(name) == "Sta" or str(name) == "A":
|
elif sub_item[0] == "Uses-1" or sub_item[0] == "U1" or sub_item[0] == "U-1":
|
||||||
Amount = line[i][0][j][k + 1]
|
Uses1 = sub_item[1]
|
||||||
elif str(name) == "Uses-1" or str(name) == "U1" or str(name) == "U-1":
|
elif sub_item[0] == "Uses-2" or sub_item[0] == "U2" or sub_item[0] == "U-2":
|
||||||
Uses1 = line[i][0][j][k + 1]
|
Uses2 = sub_item[1]
|
||||||
elif str(name) == "Uses-2" or str(name) == "U2" or str(name) == "U-2":
|
elif sub_item[0] == "Freq" or sub_item[0] == "Freq" or sub_item[0] == "F":
|
||||||
Uses2 = line[i][0][j][k + 1]
|
Freq = sub_item[1]
|
||||||
elif str(name) == "Freq" or str(name) == "Freq" or str(name) == "F":
|
elif sub_item[0] == "DUT" or sub_item[0] == "dut" or sub_item[0] == "D":
|
||||||
Freq = line[i][0][j][k + 1]
|
DUT = sub_item[1]
|
||||||
elif str(name) == "DUT" or str(name) == "dut" or str(name) == "D":
|
elif sub_item[0] == "DUT_Radio" or sub_item[0] == "dr" or sub_item[0] == "DR":
|
||||||
DUT = line[i][0][j][k + 1]
|
DUT_Radio = sub_item[1]
|
||||||
elif str(name) == "DUT_Radio" or str(name) == "dr" or str(name) == "DR":
|
elif sub_item[0] == "Traffic" or sub_item[0] == "Traf" or sub_item[0] == "T":
|
||||||
DUT_Radio = line[i][0][j][k + 1]
|
Traffic = sub_item[1]
|
||||||
elif str(name) == "Traffic" or str(name) == "Traf" or str(name) == "T":
|
elif sub_item[0] == "VLAN" or sub_item[0] == "Vlan" or sub_item[0] == "V":
|
||||||
Traffic = line[i][0][j][k + 1]
|
VLAN = sub_item[1]
|
||||||
elif str(name) == "VLAN" or str(name) == "Vlan" or str(name) == "V":
|
|
||||||
VLAN = line[i][0][j][k + 1]
|
|
||||||
else:
|
else:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user