cnaas-nms
cnaas-nms copied to clipboard
Get facts for cisco devices fails
os_version for some Cisco devices can exceed 64 chars and won't fit into the database (max 64 chars) Example os_version: "C2960X Software (C2960X-UNIVERSALK9-M), Version 15.2(2)E7, RELEASE SOFTWARE (fc3)" (81 characters)
Should we really store that entire string? Seems like NAPALM gets it via "show version" and then:
_, os_version = line.split("Cisco IOS Software, ")
If you ask about version via NETCONF API you would get something like "
Maybe we need some logic of our own to normalize os versions. You could do, if platform == "ios" then:
>>> m = re.match(r"[0-9]{2}\.[0-9]+.*", "C2960X Software (C2960X-UNIVERSALK9-M), Version 15.2(2)E7, RELEASE SOFTWARE (fc3)")
>>> m.groups()
('15.2(2)E7, RELEASE SOFTWARE (fc3)',)