Skip to content

Commit

Permalink
Merge pull request #34 from napalm-automation-community/develop
Browse files Browse the repository at this point in the history
Release 4.0.2
  • Loading branch information
bewing authored Jan 30, 2024
2 parents 716109b + 5dd1bfb commit b7845ae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
10 changes: 3 additions & 7 deletions napalm_mos/mos.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def _load_config(self, filename=None, config=None, replace=False):

if filename is not None:
with open(filename, "r") as f:
self._candidate = f.readlines()
lines = f.readlines()
else:
if isinstance(config, list):
lines = config
Expand All @@ -260,7 +260,8 @@ def _load_config(self, filename=None, config=None, replace=False):
continue
self._candidate.append(line)

self._candidate.append("end")
if self._candidate[-1] != "end":
self._candidate.append("end")
if any(
"source mac" in line for line in self._candidate
) and self._version < LooseVersion("0.19.2"):
Expand Down Expand Up @@ -523,7 +524,6 @@ def _transform_lldp_capab(self, capabilities):
)

def get_lldp_neighbors_detail(self, interface=""):

lldp_neighbors_out = {}

commands = ["show lldp neighbor {} verbose".format(interface)]
Expand All @@ -535,10 +535,8 @@ def get_lldp_neighbors_detail(self, interface=""):
interface_list = zip(*(iter(interfaces_split),) * 2)

for interface, interface_str in interface_list:

lldp_neighbors_out[interface] = []
for neighbor_str in interface_str.strip().split("\n\n"):

info_dict = {}

for info_line in neighbor_str.strip().splitlines():
Expand Down Expand Up @@ -615,7 +613,6 @@ def cli(self, commands, encoding="text"):
return cli_output

def get_arp_table(self, vrf=""):

if vrf:
raise NotImplementedError("Metamako MOS does not support multiple VRFs")

Expand Down Expand Up @@ -727,7 +724,6 @@ def get_snmp_information(self):

community_outputs = snmp_config[3]["output"].split("\n\n")
for community_output in community_outputs:

match = self._RE_SNMP_COMM.search(community_output)
if match:
matches = match.groupdict("")
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""setup.py file."""

from setuptools import setup, find_packages

__author__ = "Benny Holmgren <benny@holmgren.id.au>"
Expand All @@ -8,7 +9,7 @@

setup(
name="napalm-mos",
version="4.0.1",
version="4.0.2",
packages=find_packages(),
author="Benny Holmgren, Brandon Ewing",
author_email="benny@holmgren.id.au, brandon.ewing@warningg.com",
Expand Down
1 change: 1 addition & 0 deletions test/unit/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test fixtures."""

from builtins import super

import pytest
Expand Down

0 comments on commit b7845ae

Please sign in to comment.