I have a problem with the split function in the dnac template editor.
In the simulation the script is working but its not working on an 9300L.
See the affected code below:
#set($desc = $line.split(':')) <- $line is "I am a port description:25"
#set($description = $desc) <- this output is correct in the interface so "I am a port description"
#set($vlan = $desc) <- If I delete this line the code above is working, if used -> DNAC not use this template.
so does anyone have an idea?
Can you be more specific about what the issue is and which Cisco DNA version you are testing on?
I created a template with the following:
#set($desc = $line.split(':'))
#set($description = $desc)
#set($vlan = $desc)
interface vlan $vlan
for a 9300 (non-L). After I added the template to my network profile for that site, it provisioned as expected.
Yes sure, I use my template in a sequence at the last step.
If I delete the line #set($vlan = $desc) the template is working.
With the line it ends with the template before (in the sequence).
There is also no issue / warning, so in the logging tab (provision -> device -> template status) I cannot see the last template.
DNAC Version 188.8.131.52
I also tried to rename the variables, not working.
Are your templates part of a composite template, or just multiple regular templates?
I found a bug, CSCvt96529 (Provisioning shows as Success even if second template was not configured ) that explains that it is possible that the provision can be reported as a success even if it wasn't. I don't believe it is fixed yet in the 1.3.3 train. I think the easiest way to troubleshoot it is to try to apply only the one template with the questionable line included. Expect it to fail, and expect to see an error explaining why in the status logs.
It wasn't expected to work. The hope is that it will not pretend to succeed. Can you be more specific about what happens with the single template when you try to provision? Any errors shown?
Please open a TAC case, with the exact template you are trying to use, so they can repro if necessary and get to the bottom of this for you.
Have you tried a different variable name? I believe some variables are reserved by the system, so while the template might pass validation, when you actually go to apply it, the variable conflicts and it fails. Maybe try #set($intVlan = $desc)?