Skip to content

Commit

Permalink
process lines loaded from file like other sources
Browse files Browse the repository at this point in the history
Closes #32
  • Loading branch information
bewing committed Jan 30, 2024
1 parent ed69b51 commit d3e4830
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 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

0 comments on commit d3e4830

Please sign in to comment.