Merge pull request #60 from napalm-automation-community/f-sg300-portchannel

Fix show interfaces parsing
This commit is contained in:
Petr Klíma authored and GitHub committed 2020-11-18 11:57:53 +01:00
commit 9ce9af6e37
6 files changed
+175 -1

No files matched your search

+4 -1
View File
@@ -408,7 +408,10 @@ class S350Driver(NetworkDriver):
for status_line in show_status_output.splitlines():
if 'Up' in status_line or 'Down' in status_line:
interface, _, _, speed, _, _, link_state, _, _ = status_line.split()
if "Po" in status_line:
interface, _, _, speed, _, _, link_state = status_line.split()
else:
interface, _, _, speed, _, _, link_state, _, _ = status_line.split()
# Since the MAC address for all the local ports are equal, get the address
# from the first port and use it everywhere.
@@ -0,0 +1,101 @@
{
"gi1": {
"description": "test1",
"is_enabled": true,
"is_up": true,
"last_flapped": -1.0,
"mac_address": "50:F7:22:AA:BB:CC",
"mtu": 1518,
"speed": 1000
},
"gi10": {
"description": "",
"is_enabled": false,
"is_up": false,
"last_flapped": -1.0,
"mac_address": "50:F7:22:AA:BB:CC",
"mtu": 1518,
"speed": 0
},
"gi2": {
"description": "test2",
"is_enabled": false,
"is_up": false,
"last_flapped": -1.0,
"mac_address": "50:F7:22:AA:BB:CC",
"mtu": 1518,
"speed": 0
},
"gi3": {
"description": "",
"is_enabled": false,
"is_up": false,
"last_flapped": -1.0,
"mac_address": "50:F7:22:AA:BB:CC",
"mtu": 1518,
"speed": 0
},
"gi4": {
"description": "",
"is_enabled": false,
"is_up": false,
"last_flapped": -1.0,
"mac_address": "50:F7:22:AA:BB:CC",
"mtu": 1518,
"speed": 0
},
"gi5": {
"description": "test5",
"is_enabled": false,
"is_up": false,
"last_flapped": -1.0,
"mac_address": "50:F7:22:AA:BB:CC",
"mtu": 1518,
"speed": 0
},
"gi6": {
"description": "",
"is_enabled": true,
"is_up": true,
"last_flapped": -1.0,
"mac_address": "50:F7:22:AA:BB:CC",
"mtu": 1518,
"speed": 1000
},
"gi7": {
"description": "",
"is_enabled": false,
"is_up": false,
"last_flapped": -1.0,
"mac_address": "50:F7:22:AA:BB:CC",
"mtu": 1518,
"speed": 0
},
"gi8": {
"description": "",
"is_enabled": true,
"is_up": true,
"last_flapped": -1.0,
"mac_address": "50:F7:22:AA:BB:CC",
"mtu": 1518,
"speed": 1000
},
"gi9": {
"description": "",
"is_enabled": false,
"is_up": false,
"last_flapped": -1.0,
"mac_address": "50:F7:22:AA:BB:CC",
"mtu": 1518,
"speed": 0
},
"Po1": {
"description": "",
"is_enabled": true,
"is_up": true,
"last_flapped": -1.0,
"mac_address": "50:F7:22:AA:BB:CC",
"mtu": 1518,
"speed": 1000
}
}
@@ -0,0 +1,23 @@
Port Description
------- -----------
gi1 test1
gi2 test2
gi3
gi4
gi5 test5
gi6
gi7
gi8
gi9
gi10
Ch Description
------- -----------
Po1
Po2
Po3
Po4
Po5
Po6
Po7
Po8
@@ -0,0 +1,25 @@
Flow Link Back Mdix
Port Type Duplex Speed Neg ctrl State Pressure Mode
-------- ------------ ------ ----- -------- ---- ----------- -------- -------
gi1 1G-Copper Full 1000 Enabled Off Up Disabled On
gi2 1G-Copper -- -- -- -- Down -- --
gi3 1G-Copper -- -- -- -- Down -- --
gi4 1G-Copper -- -- -- -- Down -- --
gi5 1G-Copper -- -- -- -- Down -- --
gi6 1G-Copper Full 1000 Enabled Off Up Disabled Off
gi7 1G-Copper -- -- -- -- Down -- --
gi8 1G-Copper Full 1000 Enabled Off Up Disabled On
gi9 1G-Combo-C -- -- -- -- Down -- --
gi10 1G-Combo-C -- -- -- -- Down -- --
Flow Link
Ch Type Duplex Speed Neg control State
-------- ------- ------ ----- -------- ------- -----------
Po1 1G Full 1000 Enabled Off Up
Po2 -- -- -- -- -- Not Present
Po3 -- -- -- -- -- Not Present
Po4 -- -- -- -- -- Not Present
Po5 -- -- -- -- -- Not Present
Po6 -- -- -- -- -- Not Present
Po7 -- -- -- -- -- Not Present
Po8 -- -- -- -- -- Not Present
@@ -0,0 +1,19 @@
Device ID: 50:f7:22:aa:bb:cc
Port ID: gi1
Capabilities: Bridge
System Name: switchaabbcc
802.3 EEE:
17
17
17
17
802.1 PVID: 1
802.1 PPVID:
802.1 VLAN:
802.1 Protocol:
@@ -0,0 +1,3 @@
Jumbo frames are disabled
Jumbo frames will be disabled after reset