cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
206
Views
0
Helpful
1
Replies

dnac template error

MSJ1
Level 5
Level 5

I am newbie to DNAC templating. When I am creating a script to read any selected interfaces from a sw and trying to configure selected ports with 2 switchport command it gives error on those switchport command.

any suggestions  ?

#foreach ($interface in ${interfaces})
#if ($interface.interfaceType == "Physical" && $interface.mediaType == "10/100/1000BaseTX")

interface $interface.portName
switchport mode access
switchport access vlan 701
#end
#end

1 Reply 1

lori34rhode
Community Member

To fix this, you need to tell Velocity to eat (or "slurp") the blank lines and spaces created by your logic loops. You do this by adding a backslash (\) at the end of your control lines, or by keeping the directives tightly formatted.   OpenSkyCC login