ssl_adapter.py doesn't work on RDO
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Juniper Openstack | Status tracked in Trunk | |||||
R3.0 |
Fix Committed
|
Undecided
|
Unassigned | |||
Trunk |
Fix Committed
|
Undecided
|
Unassigned |
Bug Description
A system running RDO Kilo (on EL 7) has the following two relevant packages installed:
python-requests --> /usr/lib/
python-urllib3 --> /usr/lib/
The SSL Adapter in contrail-
When using SSL against Keystone v3 from the contrail-api, that uses this code, on a system such as the above, there will be a class loader type bug, due to a incorrect order of imports in ssl_adapter.py.
First, the bug, using the attached test_case.py, with some added debugging within /usr/lib/
[root@dev14 ~]# ./testcase.py
('1: ', <bound method apa.openks of <__main__.apa object at 0x261ba50>>)
('minapa._ks: ', None)
('2: ', <bound method apa.openks of <__main__.apa object at 0x261ba50>>)
('minapa._ks: ', None)
'openks definition'
('retval: ', None)
('minapa._ks: ', <requests.
HTTP get
xxx: connectionpool: timeout: Timeout(connect=3, read=3, total=None)
xxx: connectionpool TYPE: timeout: <class 'requests.
_get_timeout: timeout: Timeout(connect=3, read=3, total=None)
_get_timeout TYPE: timeout: <class 'requests.
_get_timeout TYPE: testtimeout: <class 'requests.
_get_timeout: timeout: Timeout(connect=3, read=3, total=None)
_get_timeout TYPE: timeout: <class 'requests.
_get_timeout TYPE: testtimeout: <class 'requests.
xxx: connectionpool: timeout: Timeout(connect=3, read=3, total=None)
xxx: connectionpool TYPE: timeout: <class 'requests.
_get_timeout: timeout: Timeout(connect=3, read=3, total=None)
_get_timeout TYPE: timeout: <class 'requests.
_get_timeout TYPE: testtimeout: <class 'requests.
_get_timeout: timeout: Timeout(connect=3, read=3, total=None)
_get_timeout TYPE: timeout: <class 'requests.
_get_timeout TYPE: testtimeout: <class 'requests.
<Response [200]>
HTTPS get
xxx: connectionpool: timeout: Timeout(connect=7, read=7, total=None)
xxx: connectionpool TYPE: timeout: <class 'requests.
_get_timeout: timeout: Timeout(connect=7, read=7, total=None)
_get_timeout TYPE: timeout: <class 'requests.
_get_timeout TYPE: testtimeout: <class 'urllib3.
Traceback (most recent call last):
File "./testcase.py", line 46, in <module>
main()
File "./testcase.py", line 41, in main
resp = minapa._ks.get("https:/
File "/usr/lib/
return self.request('GET', url, **kwargs)
File "/usr/lib/
resp = self.send(prep, **send_kwargs)
File "/usr/lib/
r = adapter.
File "/usr/lib/
timeout=timeout
File "/usr/lib/
timeout_obj = self._get_
File "/usr/lib/
return Timeout.
File "/usr/lib/
return Timeout(
File "/usr/lib/
self._connect = self._validate_
File "/usr/lib/
"int or float." % (name, value))
ValueError: Timeout value connect was Timeout(connect=7, read=7, total=None), but it must be an int or float.
From the debugging, we see that the code around https:/
This happens due to incorrect order of import statements in contrail-
This is unfixed in master (thereby, by policy, in all versions?)
A patch will be submitted shortly.
tags: | added: config |
tags: | removed: contrail-control |
/usr/lib/ python2. 7/site- packages/ urllib3/ connectionpool. py with some simple debug lines to demonstrate the error more clearly