mirror of
https://github.com/napalm-automation-community/napalm-vyos.git
synced 2026-09-22 12:11:15 +00:00
Update serial_number and model
Updated the match pattern of serial_number and model to the current 1.2/1.3 release of Vyos, maintained code for older versions
This commit is contained in:
@@ -698,10 +698,15 @@ class VyOSDriver(NetworkDriver):
|
|||||||
ver_str = [line for line in output if "Version" in line][0]
|
ver_str = [line for line in output if "Version" in line][0]
|
||||||
version = self.parse_version(ver_str)
|
version = self.parse_version(ver_str)
|
||||||
|
|
||||||
sn_str = [line for line in output if "S/N" in line][0]
|
above_1_1 = True if version.startswith('1.0') or version.startswith(1.1) else False
|
||||||
snumber = self.parse_snumber(sn_str)
|
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)
|
hwmodel = self.parse_hwmodel(hwmodel_str)
|
||||||
|
|
||||||
output = self.device.send_command("show configuration")
|
output = self.device.send_command("show configuration")
|
||||||
|
|||||||
Reference in New Issue
Block a user