You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Based on napalm documentation the compare_config() should be returning a string - https://napalm.readthedocs.io/en/latest/base.html#napalm.base.base.NetworkDriver.compare_config
Current compare_config implementation for JSON returns list of dictionaries. Also that's missing any formatting so it's not easy for human to review.
Also the current format/data type is not consistent with the return values from compare_config() for on-box set-style diff - which is nicely formatted human readable string.
The simplest fix might be to return pprint.pprint(<diff>) from the JSON diff. With exception of "no diff' for which I think napalm should be returning empty string.
Best fix I guess might be some form of unified-diff style output - lines with '+' prefix for added parts, '-' line prefix for removed parts.
The text was updated successfully, but these errors were encountered:
Based on napalm documentation the compare_config() should be returning a string - https://napalm.readthedocs.io/en/latest/base.html#napalm.base.base.NetworkDriver.compare_config
Current compare_config implementation for JSON returns list of dictionaries. Also that's missing any formatting so it's not easy for human to review.
Also the current format/data type is not consistent with the return values from compare_config() for on-box set-style diff - which is nicely formatted human readable string.
The simplest fix might be to return
pprint.pprint(<diff>)
from the JSON diff. With exception of "no diff' for which I think napalm should be returning empty string.Best fix I guess might be some form of unified-diff style output - lines with '+' prefix for added parts, '-' line prefix for removed parts.
The text was updated successfully, but these errors were encountered: