nuagenetworks/monolithe

Failed to run example

JenningsWu opened this issue · 4 comments

  • OS: ubuntu 16.04
  • Python 2.7.11 & pip: 8.1.2

When I tried to run

./examples/demo-client.py

I got

Traceback (most recent call last):
File "/home/jennings/.local/lib/python2.7/site-packages/flask/app.py", line 1836, in call
return self.wsgi_app(environ, start_response)
File "/home/jennings/.local/lib/python2.7/site-packages/flask/app.py", line 1820, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/home/jennings/.local/lib/python2.7/site-packages/flask/app.py", line 1403, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/jennings/.local/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/home/jennings/.local/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/jennings/.local/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/jennings/.local/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/home/jennings/.local/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
return self.view_functionsrule.endpoint
File "/home/jennings/test-dev/monolithe/examples/demo-server.py", line 21, in get_lists
if not lib.check_auth(request):
File "/home/jennings/test-dev/monolithe/examples/minilib/lib.py", line 13, in check_auth
decoded_auth = base64.urlsafe_b64decode(str(encoded_auth))
File "/usr/lib/python2.7/base64.py", line 119, in urlsafe_b64decode
"""
File "/home/jennings/.local/lib/python2.7/site-packages/future/types/newstr.py", line 390, in translate
if ord(c) in table:
TypeError: 'in ' requires string as left operand, not int

And all seem to go back to normal after deleting the from builtins import * lines in example/minilib/lib.py & example/minilib/data.py.

t00f commented

@JenningsWu Thanks for reporting this issue.
It seems the futurization using builtins.str was very optimistic. I checked with py2.7 and it is now working.

Could you please try to update your monolithe version to the laster commit and confirm so I can close this issue ?

Thanks

demo-client works.

tdl list tasks --in lists 2 will get [Error] Failed fetching parent lists with uuid 2. It may also need to use list(filter(...)) in def get_list(lid).

t00f commented

@JenningsWu
I just fixed the missing list() call. Let me know if it does fix your problem.

It works, thank you!