py-junos-eznc icon indicating copy to clipboard operation
py-junos-eznc copied to clipboard

cRPD JSON formatting doesn't work

Open topranks opened this issue 3 years ago • 0 comments

Hi,

This is less an issue with PyEz and more with cRPD, however I am only trial user so I do not think I can report issue to JTAC for cRPD.

Problem is fairly simple. cRPD (I am using trial version 19.4R1.10) returns the following for facts.get("version_info"):

junos.version_info(major=(0, 0), type=I, minor=0, build=0)

This value is used by device.py here, to determine if the JunOS version is recent enough to support JSON formatting. Because crpd returns 0 for the version info the 'if' evaluates to false, so the JSON commands are skipped and we get this error:

/usr/local/lib/python3.9/dist-packages/junos_eznc-2.6.5-py3.9.egg/jnpr/junos/device.py:886: RuntimeWarning: Native JSON support is only from 14.2 onwards
  warnings.warn(

I'm just messing with this in the lab, so it's easy enough for make a small change to devices.py to force it to work. It might be worth incorporating such a work-around at this point for crpd, or possibly ask the crpd dev team to fix the problem whereby the version_info returns with zeros.

topranks avatar Sep 11 '22 15:09 topranks