Include python-routes 1.12 in Lucid PPA (openstack api doesn't work with lucid one)

Bug #750782 reported by clayg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nova (Ubuntu)
Invalid
High
Unassigned

Bug Description

If you're running ubuntu 10.04 and you installed routes via apt-get, then trying to run "nova list" causes an unhanded exception in nova-api

# nova list
invalid literal for int() with base 10: 'detail' (HTTP 500)

2011-04-04 21:30:50,311 DEBUG routes.middleware [-] Matched GET /servers/detail from (pid=21680) __call__ /usr/lib/pymodules/python2.6/routes/middleware.py:97
2011-04-04 21:30:50,311 DEBUG routes.middleware [-] Route path: 'servers/:server_id/consoles/:(id)', defaults: {'action': u'show', 'controller': <nova.api.openstack.consoles.Controller object at 0x3c61d90>, 'id': None} from (pid=21680) __call__ /usr/lib/pymodules/python2.6/routes/middleware.py:99
2011-04-04 21:30:50,311 DEBUG routes.middleware [-] Match dict: {'action': u'show', 'server_id': u'detail', 'controller': <nova.api.openstack.consoles.Controller object at 0x3c61d90>, 'id': None} from (pid=21680) __call__ /usr/lib/pymodules/python2.6/routes/middleware.py:100
/v1.0/servers/detail
2011-04-04 21:30:50,312 ERROR nova.api.openstack [-] Caught error: invalid literal for int() with base 10: 'detail'
(nova.api.openstack): TRACE: Traceback (most recent call last):
(nova.api.openstack): TRACE: File "/opt/nova/nova/api/openstack/__init__.py", line 58, in __call__
(nova.api.openstack): TRACE: return req.get_response(self.application)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/webob/request.py", line 919, in get_response
(nova.api.openstack): TRACE: application, catch_exc_info=False)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/webob/request.py", line 887, in call_application
(nova.api.openstack): TRACE: app_iter = application(self.environ, start_response)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/webob/dec.py", line 159, in __call__
(nova.api.openstack): TRACE: return resp(environ, start_response)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/webob/dec.py", line 159, in __call__
(nova.api.openstack): TRACE: return resp(environ, start_response)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/webob/dec.py", line 159, in __call__
(nova.api.openstack): TRACE: return resp(environ, start_response)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/routes/middleware.py", line 130, in __call__
(nova.api.openstack): TRACE: response = self.app(environ, start_response)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/webob/dec.py", line 159, in __call__
(nova.api.openstack): TRACE: return resp(environ, start_response)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/webob/dec.py", line 147, in __call__
(nova.api.openstack): TRACE: resp = self.call_func(req, *args, **self.kwargs)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/webob/dec.py", line 208, in call_func
(nova.api.openstack): TRACE: return self.func(req, *args, **kwargs)
(nova.api.openstack): TRACE: File "/opt/nova/nova/wsgi.py", line 354, in __call__
(nova.api.openstack): TRACE: result = method(**arg_dict)
(nova.api.openstack): TRACE: File "/opt/nova/nova/api/openstack/consoles.py", line 79, in show
(nova.api.openstack): TRACE: int(server_id),
(nova.api.openstack): TRACE: ValueError: invalid literal for int() with base 10: 'detail'
(nova.api.openstack): TRACE:

There's a number of tests that break with routes 1.11
e.g.
# nosetests nova/tests/api/openstack/test_servers.py:ServersTest.test_get_server_by_id -v
test_get_server_by_id (nova.tests.api.openstack.test_servers.ServersTest) ... ERROR

======================================================================
ERROR: test_get_server_by_id (nova.tests.api.openstack.test_servers.ServersTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/nova/nova/tests/api/openstack/test_servers.py", line 165, in test_get_server_by_id
    self.assertEqual(res_dict['server']['id'], 1)
KeyError: 'server'
-------------------- >> begin captured stdout << ---------------------
/v1.0/servers/1

--------------------- >> end captured stdout << ----------------------
-------------------- >> begin captured logging << --------------------
<migration log messages removed>
routes.middleware: DEBUG: Initialized with method overriding = True, and path info altering = True
routes.middleware: DEBUG: Initialized with method overriding = True, and path info altering = True
routes.middleware: DEBUG: Initialized with method overriding = True, and path info altering = True
routes.middleware: DEBUG: Initialized with method overriding = True, and path info altering = True
routes.middleware: DEBUG: Matched GET /servers/1
routes.middleware: DEBUG: Route path: 'servers/:server_id/consoles/:(id)', defaults: {'action': u'show', 'controller': <nova.api.openstack.consoles.Controller object at 0x2fbda90>, 'id': None}
routes.middleware: DEBUG: Match dict: {'server_id': u'1', 'req': <Request at 0x323d810 GET http://localhost/v1.0/servers/1>, 'id': None}
nova.api.openstack: ERROR: Caught error: int() argument must be a string or a number, not 'NoneType'
Traceback (most recent call last):
  File "/opt/nova/nova/api/openstack/__init__.py", line 58, in __call__
    return req.get_response(self.application)
  File "/usr/lib/pymodules/python2.6/webob/request.py", line 919, in get_response
    application, catch_exc_info=False)
  File "/usr/lib/pymodules/python2.6/webob/request.py", line 887, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 159, in __call__
    return resp(environ, start_response)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 159, in __call__
    return resp(environ, start_response)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 159, in __call__
    return resp(environ, start_response)
  File "/usr/lib/pymodules/python2.6/routes/middleware.py", line 130, in __call__
    response = self.app(environ, start_response)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 159, in __call__
    return resp(environ, start_response)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/opt/nova/nova/wsgi.py", line 354, in __call__
    result = method(**arg_dict)
  File "/opt/nova/nova/api/openstack/consoles.py", line 80, in show
    int(id))
TypeError: int() argument must be a string or a number, not 'NoneType'
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 1 test in 0.913s

FAILED (errors=1)

Upgrading to routes 1.12 (e.g. from PyPi) seems to fix the problem:

root@ubuntu:~# pip freeze | grep -i routes
Routes==1.11
root@ubuntu:~# aptitude show python-routes
Package: python-routes
State: installed
Automatically installed: no
Version: 1.11-1
Priority: optional
Section: universe/python
Maintainer: Ubuntu Developers <email address hidden>
Uncompressed Size: 205k
Depends: python-support (>= 0.90.0)
Recommends: python-webob
Suggests: python-paste
Description: Routing Recognition and Generation Tools
 Routes is a Python re-implementation of the Rails routes system for mapping URLs to Controllers/Actions and generating URLs. Routes makes it easy to create
 pretty and concise URLs that are RESTful with little effort.

 Speedy and dynamic URL generation means you get a URL with minimal cruft (no big dangling query args). Shortcut features like Named Routes cut down on
 repetitive typing.

 Current features:
 * Named Routes
 * Sophisticated Route lookup and URL generation
 * Wildcard path's before and after static parts
 * Groupings syntax to allow flexible URLs to accommodate almost any need
 * Sub-domain support built-in
 * Conditional matching based on domain, cookies, HTTP method (RESTful), and more
 * Easily extensible utilizing custom condition functions and route generation functions
 * Extensive unit tests
Homepage: http://routes.groovie.org/

root@ubuntu:~# aptitude remove python-routes -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
The following packages will be REMOVED:
  python-routes
0 packages upgraded, 0 newly installed, 1 to remove and 52 not upgraded.
Need to get 0B of archives. After unpacking 205kB will be freed.
Writing extended state information... Done
(Reading database ... 36941 files and directories currently installed.)
Removing python-routes ...
Processing triggers for python-support ...
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Writing extended state information... Done

root@ubuntu:~# pip freeze | grep -i routes
Routes==1.12.3
root@ubuntu:~#
root@ubuntu:~# cd /opt/nova/
root@ubuntu:/opt/nova# nosetests nova/tests/api/openstack/test_servers.py:ServersTest.test_get_server_by_id -v
test_get_server_by_id (nova.tests.api.openstack.test_servers.ServersTest) ... ok

----------------------------------------------------------------------
Ran 1 test in 1.768s

OK

Tags: ppa
Revision history for this message
Thierry Carrez (ttx) wrote :

Not really a nova bug, but rather an Ubuntu PPA packaging issue

Changed in nova:
status: New → Invalid
Changed in nova (Ubuntu):
importance: Undecided → High
status: New → Confirmed
Thierry Carrez (ttx)
summary: - openstack api doesn't work with lucid python-routes
+ Include python-routes 1.12 in Lucid PPA (openstack api doesn't work with
+ lucid one)
Revision history for this message
Thierry Carrez (ttx) wrote :

Tracking PPA-specific bugs in Nova with a "ppa" tag.

Changed in nova:
status: Invalid → Triaged
importance: Undecided → Medium
tags: added: ppa
Changed in nova (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Brian Waldon (bcwaldon) wrote :

Not even sure we are concerned with this anymore...

no longer affects: nova
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.