fix: enable_shell_access.py: correct connection errors handling.

This commit is contained in:
Victor Golovanenko
2025-08-06 08:42:53 +03:00
parent 540e712452
commit f8407fed8f

View File

@@ -162,7 +162,7 @@ if __name__ == '__main__':
if input('Config successfully uploaded. Do you want to reboot ONU now? (Y/n) : ').lower() != 'n': if input('Config successfully uploaded. Do you want to reboot ONU now? (Y/n) : ').lower() != 'n':
try: try:
resp = http.post('/post.json', json={'module': 'dev_config', 'reboot': 1}) resp = http.post('/post.json', json={'module': 'dev_config', 'reboot': 1})
except (httpx.ConnectError, httpx.ReadError): except (httpx.TimeoutException, httpx.NetworkError):
print('ONU reboot error. The device is probably already rebooting.') print('ONU reboot error. The device is probably already rebooting.')
sys.exit(0) sys.exit(0)
else: else: