Fix #11630
openinstall task version detection cleanup
0%
Description
As I was looking into the failure Yuri filed in #11591, I see that teuthology/task/install.py
has a couple of patterns like this:
r = remote.run( args=['wget', '-q', '-O-', base_url + '/version'], stdout=StringIO(), check_status=False, ) if r.exitstatus != 0: if wait: log.info('Package not there yet, waiting...') time.sleep(15) continue raise VersionNotFoundError(base_url) break
There are a couple of issues:
1) VersionNotFoundError
only gives us the URL, not the HTTP error code. So we know wget failed to download the file, but the lack of more information means we don't know any more information about the state of the reverse-proxy server, backend webserver, or internet connectivity at the time of the failure.
2) We make the HTTP GET as a remote command, and the immediately feed the version string back into Python. It would be more efficient to just do this HTTP request directly instead of running on the remote.
Regarding 2 above, Zack speculated that this might have been done on the remote node in order to implicitly verify that we're going to have HTTP connectivity from the remote node out to gitbuilder for the rest of the installation procedure. If there are indeed network problems with one remote accessing gitbuilder, I think that we should just let that error arise within yum or apt so that it will be easier to diagnose.
Removing the wget and using python-requests instead would improve the opportunity for better test coverage here, too.
Updated by Ken Dreyer almost 9 years ago
related PR: https://github.com/ceph/teuthology/pull/505