mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-03 20:27:54 +00:00
scenario.py: Improve is_port_phantom logic in case there are two ports with one name in the output
Print out the name of the port which is phantom (if applicable) Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
This commit is contained in:
@@ -60,9 +60,16 @@ class LoadScenario(Realm):
|
||||
return False
|
||||
port = self.name_to_eid(port_eid)
|
||||
port_data = self.json_get('/ports/%s/%s/%s' % (port[0], port[1], port[2]))
|
||||
if port_data['interface']['phantom']:
|
||||
print('%s is phantom' % port_eid)
|
||||
return True
|
||||
if 'interface' in port_data.keys():
|
||||
if port_data['interface']['phantom']:
|
||||
print('%s is phantom' % port_eid)
|
||||
return True
|
||||
else:
|
||||
for port in port_data['interfaces']:
|
||||
if port['phantom']:
|
||||
print('%s is phantom' % port)
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def start_test(self):
|
||||
@@ -165,10 +172,9 @@ def main():
|
||||
timeout=args.timeout,
|
||||
debug=args.debug)
|
||||
if args.check_phantom:
|
||||
print(args.check_phantom)
|
||||
for port in args.check_phantom:
|
||||
if scenario.is_port_phantom(port):
|
||||
print('Phantom ports detected')
|
||||
print('%s is phantom' % port)
|
||||
|
||||
if args.quit_on_phantom:
|
||||
if scenario.are_any_ports_phantom():
|
||||
|
||||
Reference in New Issue
Block a user