I am writing a script to config a router basically it will be webpage and it will pass arguments to python. At the moment it is just writing to a file and playing with exscript to get it writing via ssh
For example this is toned version of the script after it receives it arguments from the webpage the following is run
python myscript.py 4 newfile.txt
(4 and newfile are variables received from webpage)
then the script is like
from sys import argv
script, vlanno, filename = argv
target = open(Filename, 'w')
vlanapply = (int vlan %r) %svino
target.write(vlanapply)
ok so this works but the problem is with the output the number 4 repersents a vlan no
it comes out as int vlan '4'
then when I try apply this using exscript using conn.execute to the cisco device it throws up an invalid command error other non variable commands are working fine.
The problem is the command is int vlan 4 not int vlan '4'
how can i get rid of the ' '?