pygnmi icon indicating copy to clipboard operation
pygnmi copied to clipboard

Add option to hide prefix in the diff output

Open XioNoX opened this issue 2 years ago • 1 comments

For example in this diff output, it might be cleaner and easier to understand by the operator if the prefixes were stripped.

- /openconfig-interfaces:interfaces/interface[name=Ethernet1]/openconfig-interfaces:interface[name=Ethernet1]/config/description sretest1003
+ /openconfig-interfaces:interfaces/interface[name=Ethernet1]/openconfig-interfaces:interface[name=Ethernet1]/config/description DISABLED
- /openconfig-interfaces:interfaces/interface[name=Ethernet1]/openconfig-interfaces:interface[name=Ethernet1]/config/enabled True
+ /openconfig-interfaces:interfaces/interface[name=Ethernet1]/openconfig-interfaces:interface[name=Ethernet1]/config/enabled False
- /openconfig-interfaces:interfaces/interface[name=Ethernet1]/openconfig-if-ethernet:ethernet/openconfig-vlan:switched-vlan/config/access-vlan 1038

To something like:

- /interfaces/interface[name=Ethernet1]/interface[name=Ethernet1]/config/description sretest1003
+ /interfaces/interface[name=Ethernet1]/interface[name=Ethernet1]/config/description DISABLED
- /interfaces/interface[name=Ethernet1]/interface[name=Ethernet1]/config/enabled True
+ /interfaces/interface[name=Ethernet1]/interface[name=Ethernet1]/config/enabled False
- /interfaces/interface[name=Ethernet1]/ethernet/switched-vlan/config/access-vlan 1038

XioNoX avatar Jun 08 '23 12:06 XioNoX

I'd say, that is matter of choice. I think, maintaining the origin is important, so that you precisely know where comes the branch from. Having said that, I saw some vendors drop that entirely. PR is welcome.

akarneliuk avatar Jul 24 '23 19:07 akarneliuk

Closed as stale

akarneliuk avatar Mar 10 '25 21:03 akarneliuk