cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
818
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?

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the NSO Developer community: