fix: enable_shell_access.py: correct connection errors handling.
This commit is contained in:
@@ -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:
|
||||||
|
Reference in New Issue
Block a user