Closed davidmat50 closed 1 year ago
This problem exists if the typedef of bits datatype is used within an union also.
sample file for union case:
module my-bit-test2 {
namespace "urn:params:type_bit";
prefix type_bit;
yang-version 1.1;
typedef new_type_bits {
type bits {
bit seventh-bit {
position 0;
}
bit eighth-bit {
position 1;
}
bit ninth-bit {
position 2;
}
}
default ninth-bit;
units gbp;
description "This is new_type_bits";
}
container root-container {
leaf leaf-bits {
type bits {
bit first-bit {
position 0;
}
bit second-bit {
position 1;
}
bit third-bit {
position 2;
}
}
default first-bit;
units dollars;
description "This is leaf-bits";
}
leaf-list leaf-list-bits {
type bits {
bit forth-bit {
position 0;
}
bit fifth-bit {
position 1;
}
bit sixth-bit {
position 2;
}
}
default fifth-bit;
units usd;
/*description "This is leaf-list-bits";*/
}
leaf leaf-derived-type {
type new_type_bits;
default seventh-bit;
description "This is leaf-derived-type";
}
leaf-list leaf-list-derived-type {
type new_type_bits;
default eighth-bit;
description "This is leaf-list-derived-type";
}
leaf leaf-union {
type union {
type new_type_bits;
type boolean;
}
}
leaf-list leaf-list-union {
type union {
type new_type_bits;
type boolean;
}
}
}
}
For this file, if we try tofetch the type of new_type_bits under union , the bits details is empty. Bits() method will return empy.
little behind, but i'll take a look in next few days
fixed
If a leaf or leaf-list is having type as typedef, and if the internal type of the typedef is 'bits', then the bit information is not received.
example given below.
file: type-bit1.yang
In the above example with typedef, for nodes
leaf-derived-type
andleaf-list-derived-type
, Type() method returns a type data without 'bit' information. so BIts() method also returns empty. In the cases where typedef was not used ieleaf-bits
andleaf-list-bits
, the bits information was received as expected.