Nov-09-2016, 10:30 AM
Hi,
I am working with a script which will read and copy vlan, vlanname and subnet from a textfile to variables/list.
The reason is that I am going to use these variables to run some commands with a while loop or something, which runs the command with different vlan,vlanname and subnet each time starting at the top of the textfile.
The command is:
fvSubnet = cobra.model.fv.Subnet(fvBD, name='', descr='', ctrl='', ip='10.1.1.1/24', preferred='no', virtual='no')
I am going to replace the ip='10.1.1.1/24' with one of the variables.
Example textfile (the textfile is much larger):
10 vlan-10 10.1.1.1/24
20 vlan-20 10.1.2.1/24
30 vlan-30 10.1.3.1/24
I hope this is clear for you and hope someone can help me
I am working with a script which will read and copy vlan, vlanname and subnet from a textfile to variables/list.
The reason is that I am going to use these variables to run some commands with a while loop or something, which runs the command with different vlan,vlanname and subnet each time starting at the top of the textfile.
The command is:
fvSubnet = cobra.model.fv.Subnet(fvBD, name='', descr='', ctrl='', ip='10.1.1.1/24', preferred='no', virtual='no')
I am going to replace the ip='10.1.1.1/24' with one of the variables.
Example textfile (the textfile is much larger):
10 vlan-10 10.1.1.1/24
20 vlan-20 10.1.2.1/24
30 vlan-30 10.1.3.1/24
I hope this is clear for you and hope someone can help me