Affects Version/s: None
Fix Version/s: 2.1.2
Environments that have 2 different versions of Python cause problems when
running agent code in memory. This was encountered on an Ambari 1.6 upgrade to
2.1 where Python 2.6 had all of the site-packages, but python2.7 was being
chosen by the agent.
The `ambari-python-wrap` script is the problem. Consider the code:
- reset settings
- checking for preferable python versions
if [ -a /usr/bin/python2.7 ] && [ -z "$PYTHON" ]; then
if [ -a /usr/bin/python2.6 ] && [ -z "$PYTHON" ]; then
This is hardcoding the `PYTHONPATH` to use `site-packages` from `python2.6`.
But then, it choose the Python 2.7 executor as the wrapper. This means that
the agents will be running as Python 2.7 and executing scripts with a Python
The observed problem was that the "rpm" and "yum" packages could not be loaded
by agent code on an INSTALL command since these packages were part of the 2.6
site-packages and not 2.7 site-packages.