ConfD User Community

Configured values not appearing in possible completions for "no" command of a leaf-list node


I have a yang model with a leaf-list and a list. The leaf-list has a leaf-ref to the list’s key. Few entries are added to the list and committed .After this, while configuring the leaf-list , all the list keys appear as possible completions .But after configuring leaf-list with few values ,when any leaf-list member has to be deleted using “no” , the configured elements doesn’t appear in the possible completions .Is there any tailf statement which can provide the configured elements as possible completions for “no” command"

Below is the yang model.

 grouping test{
  list mylist{
    key "myleaf";
    leaf myleaf{
      type string;
    leaf myval{
      type string;

container dhcp {
    uses test;

    leaf-list newname{
       type string;
       tailf:non-strict-leafref {
           path "/dhcp/mylist/myleaf";

Below is the command output

labadmin-VirtualBox(config)# dhcp newname 
Possible completions:
  [  mem1  mem2  mem3             <--------The list keys appear as help --->
labadmin-VirtualBox(config)# dhcp newname [ mem1 mem2 ]
labadmin-VirtualBox(config)# commit
Commit complete.
labadmin-VirtualBox(config)# do show running-config dhcp newname 
dhcp newname [ mem1 mem2 ]
labadmin-VirtualBox(config)# no dhcp newname 
Possible completions: 
  <cr>    <---Though 2 entries are configured, nothing appear as help --->



ConfD 6.5 changed the internal representation of leaf-lists (see CHANGES and non-backwards compatible changes) and behavior may be a bit different to what you see depending on what ConfD version you use.

Before 6.5 - by default, leaf-list behaved as a single item. Running “no leaf-list” command means removing it completely - it’s not possible to remove only some part from it.

In this behavior, e.g. having “newname 3 5 8”, you need to set it to new set of values that you want to keep, e.g. “newname 3 8” - to remove 5…

This can be sometime bit cumbersome. Check these YANG annotations in user guide and see if it changes behavior in a way you need:

tailf:cli-flat-list-syntax or tailf:cli-list-syntax