cnaas-nms icon indicating copy to clipboard operation
cnaas-nms copied to clipboard

Get facts for cisco devices fails

Open indy-independence opened this issue 4 years ago • 1 comments

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)

indy-independence avatar Jan 12 '21 09:01 indy-independence

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 "16.9" so much shorter

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)',)

indy-independence avatar Jan 12 '21 13:01 indy-independence