As you probably know tmsh::get_config always returns a collection. I sometimes only want to get a single item (and make sure that it really is only a single item). That's why I thought it would be great to have a procedure that does that check every time:
set ntp [get_single_config /sys ntp]
puts "[tmsh::get_field_value $ntp description]"
And I get the following error:
test: script failed to complete:
can't eval proc: "script::run"
unexpected TCL object type
"tmsh::get_field_value $ntp description"
(procedure "script::run" line 4)
invoked from within
script did not successfully complete, status:1
When I add a get_field_value just before the return on get_single_config it works. But after it is returned from the procedure, it seems like the object type changes. Since I'm somewhat new to TCL it might just be I'm using TCL wrong. It's not like I can't work around this, but I'm curious to know what is causing this.