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

For loop in xml template

ksj
Level 1
Level 1

I am attempting to use the documented for loop in an xml template and am getting an error that says:

 

Invalid parameters or processing instruction for

 

This is the section where I am using the loop:

 

<interface xmlns="http://tail-f.com/ned/cisco-nx">
<mgmt>
<name>0</name>
<description>{$mgmt_description}</description>
<vrf>
<member>management</member>
</vrf>
<ip>
<address>
<ipaddr>{$mgmt_ip}</ipaddr>
</address>
</ip>
</mgmt>
<Vlan>
<name>1</name>
<shutdown/>
</Vlan>
<?for i=1; {$i < 55}; i={$i + 1}?>
<Ethernet>
<name>1/{$i}</name>
<enable>
<switchport>false</switchport>
</enable>
<description>Auto_Cable_Testing</description>
<ip>
<address>
<ipaddr>192.168.{$cable_test}.{$i*2}/31</ipaddr>
</address>
</ip>
<flowcontrol>
<receive>off</receive>
<send>off</send>
</flowcontrol>
</Ethernet>
<?end?>
</interface>

Any ideas on what I'm doing wrong?

 

TIA

1 Reply 1

aelganzo
Cisco Employee
Cisco Employee

 

the for loop is correctly defined, So the questions did you add mgmt_description, mgmt_ip and cable_test variables to your python?

Polls
AI-powered tools for network troubleshooting are likely to be part of everyone’s workflow sooner or later. What is the single biggest challenge or concern you see with adopting these tools in your organization?