keylime: invoke_get_quote fails on tornado 6.0
The 'callback` function has been deprecated in 6.0 release:
https://www.tornadoweb.org/en/stable/releases/v6.0.0.html
This results in the following code breaking:
and possibly…
Using config file /etc/keylime.conf
2019-10-17 12:09:44.918 - keylime.cloudverifier - INFO - Starting Cloud Verifier (tornado) on port 8881, use <Ctrl-C> to stop
2019-10-17 12:09:44.919 - keylime.cloudverifier_common - INFO - Setting up TLS...
2019-10-17 12:09:44.920 - keylime.cloudverifier_common - INFO - Existing CA certificate found in /var/lib/keylime/cv_ca, not generating a new one
2019-10-17 12:09:44.922 - keylime.cloudverifier - INFO - Starting service for revocation notifications on port 8992
2019-10-17 12:10:33.188 - keylime.cloudverifier - ERROR - Polling thread error: __init__() got an unexpected keyword argument 'callback'
2019-10-17 12:10:33.189 - keylime.cloudverifier - ERROR - __init__() got an unexpected keyword argument 'callback'
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/keylime-1.2-py3.7.egg/keylime/cloud_verifier_tornado.py", line 406, in process_agent
self.invoke_get_quote(agent, True)
File "/usr/local/lib/python3.7/site-packages/keylime-1.2-py3.7.egg/keylime/cloud_verifier_tornado.py", line 307, in invoke_get_quote
client.fetch(url, callback=cb)
File "/usr/local/lib64/python3.7/site-packages/tornado/httpclient.py", line 284, in fetch
request = HTTPRequest(url=request, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'callback'
2019-10-17 12:10:33.192 - keylime.cloudverifier - INFO - POST returning 200 response for adding agent id: D432FBB3-D2F1-4A97-9EF7-75BD81C00000
2019-10-17 12:10:33.486 - keylime.cloudverifier - INFO - PUT returning 404 response. agent id: D432FBB3-D2F1-4A97-9EF7-75BD81C00000 not found.
I guess we will need to replace this with async code.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 16 (14 by maintainers)
Commits related to this issue
- Port verifer to tornado release 6.0.x `callback` has been depreciated from tornado 6.0 This code changes the `invoke_get_quote` from a callback to a while loop Resolves: #196 — committed to keylime/keylime by deleted user 5 years ago
- Port verifer to tornado release 6.0.x `callback` has been depreciated from tornado 6.0 This code changes the `invoke_get_quote` from a callback to a while loop Resolves: #196 — committed to keylime/keylime by deleted user 5 years ago
- Async implementation to support Tornado version 6 callbacks have now been depreciated so we need to move to using asyncio. Resolves: #196 — committed to keylime/keylime by deleted user 5 years ago
- Async implementation to support Tornado version 6 callbacks have now been depreciated so we need to move to using asyncio. Resolves: #196 — committed to keylime/keylime by deleted user 5 years ago
- Async implementation to support Tornado version 6 callbacks have now been depreciated so we need to move to using asyncio. Resolves: #196 — committed to keylime/keylime by deleted user 5 years ago
- Async implementation to support Tornado version 6 callbacks have now been depreciated so we need to move to using asyncio. Resolves: #196 — committed to keylime/keylime by deleted user 5 years ago
- Async implementation to support Tornado version 6 Callbacks have now been depreciated so we need to move to using asyncio. Also includes better detection of CA directory Resolves: #196 — committed to keylime/keylime by deleted user 5 years ago
Hi @lukehinds
I haven’t found a way to do this without using the nest-asyncio PIP package. It sounds like python and tornado developers are trying to prevent developers from doing recursive event loops, which we need here.
If you’re willing to use (and install) the
nest-asyncio
pip package, then here is a patch tocloud_verifier_tornado.py
that works on my end.What do you think?