Two vendors both support the same OpenConfig model, yet your code works on one and fails on the other. Why?
Show the answer
Say this first
Support is declared per leaf, not per model. Vendors publish deviation modules that mark nodes as not
supported or change their type or default, they implement only some optional features, and they support
different model revisions. I read what the device announces (NETCONF hello capabilities or the YANG
library, gNMI Capabilities) and test against that, per platform and per software release.
Go deeper
Where the differences hide
Deviations. A vendor module that says, for example:Output
Other forms are deviate add, replace and delete to change defaults, types or constraints.
Features.if-feature makes nodes optional. The server lists the features it implements.
Revisions. The same module name with a different revision can rename or move nodes.
Semantics. Two implementations can accept the same leaf but apply it differently, for example when
an interface needs a sub-interface 0 before an IP address is valid.
How the device tells you
NETCONF 1.0-style servers list each module in the hello as a capability URI:
A deviations= parameter, when present, names the vendor deviation modules. Newer servers point to the
YANG library (ietf-yang-library, RFC 7895 and RFC 8525), which lists modules, revisions, features and
deviations as data you can query. gNMI returns supported models in the Capabilities response.
How I protect the code
Pin the platform and release in the test lab to the ones in production.
Gather capabilities as part of pre-checks and fail fast if a required module or revision is missing.
Keep per-platform translation in one place instead of scattering if vendor == through the code.
They will ask next
Can you just ignore deviations and send the data anyway?
The device rejects nodes it does not support, usually with an unknown-element or invalid-value
error, and a NETCONF edit with the default stop-on-error stops at that point. On a candidate you can
discard, but on running some changes may already be in. Plan for it rather than discover it in production.
Traps
Testing on one release and deploying to another. Model revisions change between releases.