adjust get_interfaces_ip function for compatibility with sgx00 series
include and begin are not available on sgx00 devices
This commit is contained in:
1 parent
5a2d22302a
commit
c7d6577a2c
1 file changed
+5
-2
+5
-2
@@ -324,10 +324,13 @@ class S350Driver(NetworkDriver):
|
|||||||
def get_interfaces_ip(self):
|
def get_interfaces_ip(self):
|
||||||
"""Returns all configured interface IP addresses."""
|
"""Returns all configured interface IP addresses."""
|
||||||
interfaces = {}
|
interfaces = {}
|
||||||
show_ip_int = self._send_command('show ip int | include (UP|DOWN)')
|
valid_interfaces = []
|
||||||
|
show_ip_int = self._send_command('show ip int')
|
||||||
|
|
||||||
# Limit to valid interfaces (i.e. ignore vlan 1)
|
# Limit to valid interfaces (i.e. ignore vlan 1)
|
||||||
valid_interfaces = [i for i in show_ip_int.splitlines() if i.split()[-1] == 'Valid']
|
for line in show_ip_int.splitlines():
|
||||||
|
if ('UP' in line or 'DOWN' in line) and line.split()[-1] == 'Valid':
|
||||||
|
valid_interfaces.append(line)
|
||||||
|
|
||||||
for interface in valid_interfaces:
|
for interface in valid_interfaces:
|
||||||
network, name = interface.split()[:2]
|
network, name = interface.split()[:2]
|
||||||
|
|||||||
Reference in new issue
Block a user