It looks like you're new here. If you want to get involved, click one of these buttons!
I am having some issues writing a basic python script to configure access switches in mass.
The process I am trying to follow is –
Connect the switches to the lab network, issue IP address from a DHCP server and use auto config to load a base config (set the username, enable local login).
The python script will do the following-
Read the IP list file
Log in to the devices one by one
Update firmware (must still be completed)
Optionally load a config update file
Load a custom config file (based on device sn)
Gen new rsa key
Backs up new running config.
If I write this, one command following on the other it seems to work.
However. In order to provide more flexibility, I would prefer to write separate definitions and call these as I need them. This works to a limited extent.
The process to call the individual definitions works. The expect statements do not seem to function beyond the first definition that I call. My suspicion is that the expect telnet instance gets interrupted and do not continue to function as too as the first definition is completed.
How do I get the pexpect child statement to work on the subsequent definitions?