List keys: short name merges with long name

I have a list that has the key “name”, a leaf of type string.
From confd_cli I create a list entry with name “my_name_full” which is shown correctly. Then I create an entry in the same list with the name “my_name”. The commit is successful but this entry doesn’t appear in the database. Instead I see that the entry for “my_name_full” has been updated with the values from “my_name”… This doesn’t happen if I create the short name first.

Seems odd, what does your YANG model look like for the list?

Part of a bigger yang file, but here’s the list:

grouping service-list-config {
    container service-list-configuration {
        list service-list-item {
            key name;
            max-elements 5000;
            leaf name {
                type string;
            }
            leaf service-key {
                type uint32;
                mandatory true;
            }
            leaf status {
                type enumeration {
                    enum active;
                    enum passive;
                }
                default "active";
            }
            leaf enable-starting-services {
	    type boolean;
	    default false;
	}
       }
  }

}

Can’t reproduce. What is your exact CLI commands when you see the issue?

confd_cli commands and output:

[edit my-configuration service-list-configuration]
bol@localhost 14:39:31% show
service-list-item my_name_full {
service-key 1;
status active;
enable-starting-services true;
}
[ok][2016-10-06 14:39:34]

[edit my-configuration service-list-configuration]
bol@localhost 14:39:34% set service-list-item my_name enable-starting-services false service-key 2 status passive
[ok][2016-10-06 14:39:58]

[edit my-configuration service-list-configuration]
bol@localhost 14:39:58% commit
Commit complete.
[ok][2016-10-06 14:40:01]

[edit my-configuration service-list-configuration]
bol@localhost 14:40:01% show
service-list-item my_name_full {
service-key 2;
status passive;
enable-starting-services false;
}
[ok][2016-10-06 14:40:02]

[edit my-configuration service-list-configuration]
bol@localhost 14:40:02%

What version of ConfD are you using? Do you have a value set for /confdConfig/cli/allowAbbrevKeys in confd.conf? Try setting it explicitly to “false” (without the quotes). I believe this had a default of “true” in some versions, and there may also have been a bug such that the “true” setting was applied in cases where it should not have been - e.g. as in your case, it was impossible to create a list entry with a key that was an initial substring of an existing key, since it would always be taken as an abbreviation of the existing key (note that the CLI syntax is the same for “create a new list entry” and “set a leaf in an existing list entry”, i.e. there is no “create” command).

Personally I think the use of abbreviations in commands (in any interface) is “evil” - commands that once worked fine may become invalid, or even get a different meaning, when new parameter names - or values - are added. The ConfD CLI allows support for abbreviations to be turned off (there are a number of other cli/allowAbbrevXXX settings in confd.conf), and I think it’s a good idea to do that - but many users expect support for abbreviations, and I believe it is present in the “models” for the ConfD CLI. “Just hit <TAB> after each abbreviation” and you’ll be fine without them.:-)

That fixed it. It was true in my confd.conf.
Thanks!