Skip to content

Commit

Permalink
Merge pull request #27 from napalm-automation-community/develop
Browse files Browse the repository at this point in the history
Release 3.4.0
  • Loading branch information
bewing authored Apr 28, 2022
2 parents ccf6e07 + fc69e0e commit 61c2dec
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 25 deletions.
6 changes: 3 additions & 3 deletions napalm_mos/mos.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,13 +338,13 @@ def get_interfaces(self):
def _parse_mm_speed(speed):
"""Parse the Metamako speed string from 'sh int status' into an Mbit/s int"""

factormap = {"": 1e-6, "k": 1e-3, "M": 1, "G": 1e3, "T": 1e6}
factormap = {"": 1e-6, "k": 1e-3, "M": 1.0, "G": 1e3, "T": 1e6}
match = re.match(r"^(?P<speed>\d+)(?P<unit>\D)?$", speed)
if match:
match_dict = match.groupdict("")
return int(int(match_dict["speed"]) * factormap[match_dict["unit"]])
return float(match_dict["speed"]) * factormap[match_dict["unit"]]

return 0
return 0.0

commands = ["show interfaces status", "show interfaces description"]
output = self.device.run_commands(commands, encoding="json")
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
napalm>=3.3.0
napalm>=3.4.0
pyeapi>=0.8.1
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setup(
name="napalm-mos",
version="3.3.1",
version="3.4.0",
packages=find_packages(),
author="Benny Holmgren, Brandon Ewing",
author_email="[email protected], [email protected]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"last_flapped": 0,
"is_up": true,
"mac_address": "",
"speed": 10000,
"speed": 10000.0,
"mtu": -1
},
"et3": {
Expand All @@ -14,7 +14,7 @@
"last_flapped": 0,
"is_up": false,
"mac_address": "",
"speed": 0,
"speed": 0.0,
"mtu": -1
},
"et1": {
Expand All @@ -23,7 +23,7 @@
"last_flapped": 0,
"is_up": true,
"mac_address": "",
"speed": 10000,
"speed": 10000.0,
"mtu": -1
},
"et6": {
Expand All @@ -32,7 +32,7 @@
"last_flapped": 0,
"is_up": false,
"mac_address": "",
"speed": 0,
"speed": 0.0,
"mtu": -1
},
"et7": {
Expand All @@ -41,7 +41,7 @@
"last_flapped": 0,
"is_up": false,
"mac_address": "",
"speed": 0,
"speed": 0.0,
"mtu": -1
},
"et4": {
Expand All @@ -50,7 +50,7 @@
"last_flapped": 0,
"is_up": false,
"mac_address": "",
"speed": 0,
"speed": 0.0,
"mtu": -1
},
"et5": {
Expand All @@ -59,7 +59,7 @@
"last_flapped": 0,
"is_up": false,
"mac_address": "",
"speed": 0,
"speed": 0.0,
"mtu": -1
},
"et8": {
Expand All @@ -68,7 +68,7 @@
"last_flapped": 0,
"is_up": false,
"mac_address": "",
"speed": 0,
"speed": 0.0,
"mtu": -1
},
"et9": {
Expand All @@ -77,7 +77,7 @@
"last_flapped": 0,
"is_up": false,
"mac_address": "",
"speed": 0,
"speed": 0.0,
"mtu": -1
},
"et16": {
Expand All @@ -86,7 +86,7 @@
"last_flapped": 0,
"is_up": false,
"mac_address": "",
"speed": 0,
"speed": 0.0,
"mtu": -1
},
"et14": {
Expand All @@ -95,7 +95,7 @@
"last_flapped": 0,
"is_up": false,
"mac_address": "",
"speed": 0,
"speed": 0.0,
"mtu": -1
},
"et15": {
Expand All @@ -104,7 +104,7 @@
"last_flapped": 0,
"is_up": false,
"mac_address": "",
"speed": 0,
"speed": 0.0,
"mtu": -1
},
"ma1": {
Expand All @@ -113,7 +113,7 @@
"last_flapped": 0,
"is_up": true,
"mac_address": "",
"speed": 1000,
"speed": 1000.0,
"mtu": -1
},
"et10": {
Expand All @@ -122,7 +122,7 @@
"last_flapped": 0,
"is_up": false,
"mac_address": "",
"speed": 0,
"speed": 0.0,
"mtu": -1
},
"et11": {
Expand All @@ -131,7 +131,7 @@
"last_flapped": 0,
"is_up": false,
"mac_address": "",
"speed": 0,
"speed": 0.0,
"mtu": -1
},
"et12": {
Expand All @@ -140,7 +140,7 @@
"last_flapped": 0,
"is_up": false,
"mac_address": "",
"speed": 0,
"speed": 0.0,
"mtu": -1
},
"et13": {
Expand All @@ -149,7 +149,7 @@
"last_flapped": 0,
"is_up": false,
"mac_address": "",
"speed": 0,
"speed": 0.0,
"mtu": -1
}
}
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[tox]
envlist = py{36,37,38}-napalm{3.3.0}
envlist = py{36,37,38}-napalm{3.4.0}

[travis:env]
NAPALM =
3.3.0: napalm3.3.0
3.4.0: napalm3.4.0

[testenv]
deps =
napalm3.3.0: napalm==3.3.0
napalm3.4.0: napalm==3.4.0
-rrequirements-dev.txt
passenv = NAPALM* TOX*

Expand Down

0 comments on commit 61c2dec

Please sign in to comment.