So when we execute it via CLI get_elem() is getting called twice.
Hence we getting o/p not as 1234 , its 1236… if executed again it will print 1238 so on.
Same if we execute from netconf we getting proper o/p like 1234, 1235, 1236 etc.
So can you please help us , how to fix the show command execution properly like of netconf… making get_elem() once when show command getting executed from CLI/.
Your data provider application should not assume one callback invocation from ConfD per request.
If you want to support allocating an identifier, I suggest you use an action instead of an operational data provider.