Administrator Guide

16 Python Scripting for Dell Networking N-Series | Version 1.0.1
Though the script was installed using the start-on-boot parameter, administrators can start it at any time
using the application start
command as long as the script allows for it (e.g. command prompts are properly
detected). To turn off the start-on-boot feature while keeping the script installed to be run manually, enter the
following command to overwrite the existing install:
console(config)#application install <filename2>
Framework example
The example script above provides the framework for any set of CLI commands. For instance, administrators
can use the script to update firmware on a switch or switch stack simply by modifying the do_config
subroutine with the necessary commands. To update the firmware upon script execution, simply replace
do_config with the following:
def do_config(tn):
tn.read_until("#", TIMEOUT)
tn.write("copy tftp
://xx.xx.xx.xx/N3000_N2000vNEW.stk backup\n")
tn.read_until("(y/n)", TIMEOUT)
tn.write("y")
tn.read_until("#", TIMEOUT)
tn.write("boot system backup\n")
tn.read_until("#", TIMEOUT)
tn.write("reload\n")
tn.read_until("(y/n)", TIMEOUT)
tn.write("y")