def rebootMachine(self, waitSeconds=3): self._isRebootTriggered = True if self._controlPipe: try: self._controlPipe.executeRpc("rebootTriggered", True) except Exception as err: # pylint: disable=broad-except logger.debug(err) self.clearRebootRequest() System.reboot(wait=waitSeconds)
def run(self): while True: try: System.reboot(0) logger.notice("Reboot initiated") break except Exception as err: # pylint: disable=broad-except # Device not ready? logger.info("Failed to initiate reboot: %s", err) time.sleep(1)