def reload ( self , save_config = True ) : if save_config : self . device . send ( "copy running-config startup-config" ) self . device ( "reload" , wait_for_string = "This command will reboot the system" ) self . device . ctrl . sendline ( "y" )
reload device program code in python
Reload the device .
def reload(self, save_config=True):
        """Reload the device.

        !!!WARNING! there is unsaved configuration!!!
        This command will reboot the system. (y/n)?  [n]
        """
        if save_config:
            self.device.send("copy running-config startup-config")
        self.device("reload", wait_for_string="This command will reboot the system")
        self.device.ctrl.sendline("y")