infinite loop condition when we don't have python2.4 installed on the machine
This is a patch that fixes http://autotest.kernel.org/ticket/9
In certain cases, our target test machine might have only python2.5
installed, as it is the case of some newer distros. A condition inside a
common library that is loaded by virtually all autotest code makes
autotest and other helper programs to go on an infinite loop when we
don't have python2.4 installed.
The condition checks what python is running, if we can't get a version
(python possibly too old), or a version that is not 2.4 (our target), we
need to restart autotest execution using os.execv. However, when there's
no 2.4 installed, the best python found (2.5) will be used to re-execute
the program, the check will realize that there's no 2.4 again and will
repeat that cycle infinitely.
{{{
lucas@freedom:~/Code/Workspace/autotest-test$ python utils/packager.py
NOTE: packager.py switching to /usr/bin/python2.5
NOTE: packager.py switching to /usr/bin/python2.5
NOTE: packager.py switching to /usr/bin/python2.5
...
}}}
A sensible fix is to check beforehand what is the best (older) currently
available version, compare with the version we are already running, and
do the switch only if the versions are different (provided that we are
not running under mod_python.
Impact: High (this part of the code is executed by virtually all
autotest code)
Risk: Low (simple change, fixes the bug we are having and there's no
harmful side effects I can see right now).
Signed-off-by: Lucas Meneghel Rodrigues (lucasmr@br.ibm.com)
git-svn-id: http://test.kernel.org/svn/autotest/trunk@2616 592f7852-d20e-0410-864c-8624ca9c26a4
1 file changed