From 3198573bd1f40674642a1d4f1a91bae28d8b154d Mon Sep 17 00:00:00 2001 From: Antoine Meillet Date: Wed, 7 Feb 2024 15:22:10 +0100 Subject: [PATCH] Speed is a float in the napalm model Just like uptime, the napalm base models expects speed to be a float, so we will just be conform --- napalm_servertech_pro2/pro2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/napalm_servertech_pro2/pro2.py b/napalm_servertech_pro2/pro2.py index a11b14b..d92cf88 100644 --- a/napalm_servertech_pro2/pro2.py +++ b/napalm_servertech_pro2/pro2.py @@ -175,7 +175,7 @@ def get_interfaces(self): { "id": "NET", "name": "management", - "speed": int(net["speed"].split(" ")[0]), + "speed": float(net["speed"].split(" ")[0]), "status": "Normal" if net["link"] == "Up" else False, "state": "On", "mac_address": net["ethernet_mac_address"].replace("-", ":"), @@ -189,7 +189,7 @@ def get_interfaces(self): "is_enabled": True if port["state"] == "On" else False, "description": port["name"], "last_flapped": -1.0, - "speed": port.get("speed", 0), + "speed": port.get("speed", 0.0), "mtu": port.get("mtu", 0), "mac_address": port.get("mac_address", ""), }