Closed 0xbase12 closed 6 years ago
The pythonpath in some ubuntu VMs is not set as properly:
import sys
sys.path
['', '/usr/lib/python2.7/dist-packages', '/opt/slipstream/client/lib', '/opt/openstack', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7', '/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode']
import requests
requests.__file__
'/usr/lib/python2.7/dist-packages/requests/__init__.pyc'
As you can see the /opt/slipstream/client/lib
come after /usr/lib/python2.7/dist-packages
and so if a VM has already requests and urllib3 installed, python will use them from site packages which will be in different version of our requests
and urllib3
embded with SlipStream Client.
To fix that issue we should use virtualenv (SixSq/tasklist#1373) or force the system before importing packages to load from /opt/slipstream/client/lib
by priority:
import sys
sys.path.insert(1,'/opt/slipstream/client/lib')
import requests
requests.__file__
'/opt/slipstream/client/lib/requests/__init__.py'
This issue happen in orchestrator on eo-cloudferro-pl1