I was reading up on --allow-enum-conflicts, while trying to resolve the following when emitting c header files:
Warning: the following symbols have been suppressed due to a
conflict with an enum or bit with the same mapped name but a different value:
‘OTHER’, ‘UNKNOWN’.
Use tailf:code-name on the conflicting enums, bits, or nodes
to avoid the conflict.
I cannot modify the original yang module. Do I need to add an annotate for every leaf that uses the conflicting enums?
module module-d {
yang-version "1";
namespace "urn:params:xml:ns:yang:project:m-d";
prefix m-d;
typedef module-d-type {
type enumeration {
enum OTHER { value 1; }
enum UNKNOWN { value 0; }
}
}
typedef module-d-type2 {
type enumeration {
enum OTHER { value 2; }
enum UNKNOWN { value 3; }
}
}
grouping module-d-grouping {
container module-d-container {
list module-d-list {
key module-d-leaf;
leaf module-d-leaf { type uint8; }
leaf object-b { type string; }
leaf object-c { type module-d-type; }
leaf object-d { type module-d-type2; }
}
}
}
grouping module-d2-grouping {
leaf module-d-container { type uint32; }
}
}
...
pyang tree:
...
module: module-a
+--rw container-a
+--rw container-b
+--rw object-b? uint8
+--rw module-b-container
| +--rw module-b-list* [module-b-leaf]
| | +--rw module-b-leaf uint8
| | +--rw object-b? string
| +--rw module-d-container
| +--rw module-d-list* [module-d-leaf]
| +--rw module-d-leaf uint8
| +--rw object-b? string
| +--rw object-c? module-d-type
| +--rw object-d? module-d-type2
+--rw module-c-container
+--rw module-c-list* [module-c-leaf]
| +--rw module-c-leaf uint8
| +--rw object-b? string
| +--rw object-c? module-c-type
+--rw module-d-container? uint32