reboot_network_device command not working inside while loop
I have been trying to get this script running that will reboot all access points in an organization nightly. All code for discovering access points works correctly. At the end I have a loop to go through all the discovered APs and issue the reboot command to each one.
while n < len(serials): #print(n+1, ' - ', serials[n]) reboot['network_id'] = rebootnetids[n] reboot['serial'] = serials[n] devices_controller.reboot_network_device(reboot) n += 1 #print(reboot)
The script will run with no errors, and the lines I have commented out here will print all the correct info when not commented. I have also tried just a single reboot command for a single device outside the while loop and that worked. It seems putting it inside a loop breaks the command. What am I missing?