ConfD User Community

Deletion of single element in leaf-list


#1

Before Confd 6.5, leaf-list behaved as a single item. I am using confd 6.4.3.
In this version, it should not be possible to delete single element or part in leaf-list.
For below yang,

container network-ips {
    description "xxx";
    tailf:cli-add-mode;

    leaf-list address {
       description "yyy";
       max-elements 3;
       type inet:ip-address;
    }
 }

I have multiple elements in leaf-list

show running-config network-ips
network-ips
  address [ a b c ]
!

When element is deleted using square bracket, it is deleting whole leaf-list as expected.
But if I delete single element w/o square bracket, it is deleting single element only.

(config)# no network-ips address a

show running-config network-ips
network-ips
 address [ b c ]
!

It is contradictory to statement that leaf-list act as a single element.


#2

Actually it is not contradictory. When the underlying implementation of leaf-list was changed in ConfD 6.5 to treat it more like a list, this allowed individual items in the leaf-list to have associated meta-data. This is more important for NSO than it is for ConfD, but since the implementation is shared, ConfD also inherited this implementation change. But it has always been possible to modify a leaf-list as you show.


#3

Hi,
Thanks for your reply.

For question mentioned in, Configured values not appearing in possible completions for "no" command of a leaf-list node, the justified answer is that “no” will remove the leaf-list completely.
It is possible to remove individual elements in leaf-list, then why values do not appear in possible completions for “no” command of a leaf-list.
This is wrt Confd 6.4.3
Also what is recommended way to delete leaf-list?