Skip to content

Commit

Permalink
Merge pull request #38 from marcushoff/get_facts
Browse files Browse the repository at this point in the history
Update serial_number and model
  • Loading branch information
ppieprzycki authored Dec 17, 2020
2 parents 27bc0c7 + a205b99 commit 29ad1b8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions napalm_vyos/vyos.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,10 +698,15 @@ def get_facts(self):
ver_str = [line for line in output if "Version" in line][0]
version = self.parse_version(ver_str)

sn_str = [line for line in output if "S/N" in line][0]
snumber = self.parse_snumber(sn_str)
above_1_1 = False if version.startswith('1.0') or version.startswith('1.1') else True
if above_1_1:
sn_str = [line for line in output if "Hardware S/N" in line][0]
hwmodel_str = [line for line in output if "Hardware model" in line][0]
else:
sn_str = [line for line in output if "S/N" in line][0]
hwmodel_str = [line for line in output if "HW model" in line][0]

hwmodel_str = [line for line in output if "HW model" in line][0]
snumber = self.parse_snumber(sn_str)
hwmodel = self.parse_hwmodel(hwmodel_str)

output = self.device.send_command("show configuration")
Expand Down

0 comments on commit 29ad1b8

Please sign in to comment.