-
Bug
-
Resolution: Done
-
Undefined
-
None
-
None
-
None
-
False
-
False
-
-
1
-
2024-R1
-
Testable
https://github.com/larsbu has created an issue in GitHub https://github.com/oamg/convert2rhel/issues/1047
Title: Feature Request: reduce timeout for the 'Checking internet connectivity' check
Description:
During a conversion from CentOS7 to RHEL7 I noticed that the timeout of the internet connectivity check took some time:
`[2024-01-25T06:16:38+0000] DEBUG - Booted kernel VRA (version, release, architecture): 3.10.0-1160.102.1.el7.x86_64
Checking internet connectivity using address 'https://static.redhat.com/test/rhel-networkmanager.txt'.
WARNING - There was a problem while trying to connect to 'https://static.redhat.com/test/rhel-networkmanager.txt' to check internet connectivity. This could be due to the host being offline, or the network blocking access to the endpoint... Some checks and actions will be skipped.
[2024-01-25T06:18:46+0000] DEBUG - Failed to retrieve data from host, reason: [Errno 101] Network is unreachable`
It is possible to lower the timeout?
15-20 seconds should be sufficient.
Version: convert2rhel-1.6.1-1.el7
Location: systeminfo.py, _check_internet_access
Maybe using the timeout option?
`diff --git a/convert2rhel/systeminfo.py b/convert2rhel/systeminfo.py
index ce9afe9..6684716 100644
— a/convert2rhel/systeminfo.py
+++ b/convert2rhel/systeminfo.py
@@ -390,7 +390,7 @@ class SystemInfo:
try:
- urlopen as a context manager is only available in Python-3.0+
- pylint: disable=consider-using-with
- response = urllib.request.urlopen(CHECK_INTERNET_CONNECTION_ADDRESS)
+ response = urllib.request.urlopen(CHECK_INTERNET_CONNECTION_ADDRESS, timeout=15)
response.close()
- pylint: enable=consider-using-with
self.logger.info(
`