adjust get_arp_table function for compatibility with sgx00 series
include is not available on sgx00 devices
This commit is contained in:
1 parent
d6bc004e28
commit
7a1f027cdb
1 file changed
+5
-2
+5
-2
@@ -141,14 +141,17 @@ class S350Driver(NetworkDriver):
|
|||||||
"""
|
"""
|
||||||
arp_table = []
|
arp_table = []
|
||||||
|
|
||||||
output = self._send_command('show arp | include (static|dynamic)')
|
output = self._send_command('show arp')
|
||||||
|
|
||||||
for line in output.splitlines():
|
for line in output.splitlines():
|
||||||
# A VLAN may not be set for the entry
|
# A VLAN may not be set for the entry
|
||||||
|
if 'vlan' not in line:
|
||||||
|
continue
|
||||||
if len(line.split()) == 4:
|
if len(line.split()) == 4:
|
||||||
interface, ip, mac, _ = line.split()
|
interface, ip, mac, _ = line.split()
|
||||||
elif len(line.split()) == 5:
|
elif len(line.split()) == 5:
|
||||||
_, interface, mac, _ = line.split()
|
if1, if2, ip, mac, _ = line.split()
|
||||||
|
interface = "{} {}".format(if1, if2)
|
||||||
elif len(line.split()) == 6:
|
elif len(line.split()) == 6:
|
||||||
_, _, interface, ip, mac, _ = line.split()
|
_, _, interface, ip, mac, _ = line.split()
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in new issue
Block a user