Skip to content

Commit

Permalink
Merge pull request #1571 from DavidVentura/nxos-svi-desc
Browse files Browse the repository at this point in the history
Fix description on SVI in NXOS
  • Loading branch information
mirceaulinic committed Mar 25, 2022
2 parents aa8c50f + 19fc95d commit 53fbff3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
6 changes: 5 additions & 1 deletion napalm/nxos/nxos.py
Original file line number Diff line number Diff line change
Expand Up @@ -1022,13 +1022,17 @@ def get_interfaces(self) -> Dict[str, models.InterfaceDict]:
mac_address = interface_details["svi_mac"].strip()
else:
mac_address = None

desc = interface_details.get(
"desc", interface_details.get("svi_desc", "")
).strip('"')
interfaces[interface_name] = {
"is_up": is_up,
"is_enabled": (
interface_details.get("state") == "up"
or interface_details.get("svi_admin_state") == "up"
),
"description": str(interface_details.get("desc", "").strip('"')),
"description": desc,
"last_flapped": self._compute_timestamp(
interface_details.get("eth_link_flapped", "")
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,14 @@
"mac_address": "00:2A:6A:D3:00:00",
"mtu": 1500,
"speed": 1000
},
"Vlan199": {
"is_enabled": false,
"description": "This is a description",
"last_flapped": -1.0,
"is_up": false,
"mac_address": "00:2A:6A:D3:00:00",
"mtu": 1500,
"speed": 1000
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,19 @@
"svi_mtu": "1500",
"svi_bw": "1000000",
"svi_delay": "10"
},
{
"interface": "Vlan199",
"svi_admin_state": "down",
"state_rsn_desc": "Administratively down",
"svi_line_proto": "down",
"svi_mac": "002a.6ad3.0000",
"svi_ip_addr": "192.168.0.11",
"svi_ip_mask": "24",
"svi_mtu": "1500",
"svi_bw": "1000000",
"svi_delay": "10",
"svi_desc": "This is a description"
}
]
}
Expand Down

0 comments on commit 53fbff3

Please sign in to comment.