Api traceback when using novatools list

Bug #722246 reported by Antony Messerli
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Dan Prince

Bug Description

I get this using novatools list or various other commands through novatools, running rev 706 of trunk.

2011-02-20 10:31:26,277 ERROR nova.api.openstack [-] Caught error: 'NoneType' object is unsubscriptable
(nova.api.openstack): TRACE: Traceback (most recent call last):
(nova.api.openstack): TRACE: File "/root/openstack/nova/nova/api/openstack/__init__.py", line 53, 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 131, 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 "/root/openstack/nova/nova/wsgi.py", line 323, in __call__
(nova.api.openstack): TRACE: result = method(**arg_dict)
(nova.api.openstack): TRACE: File "/root/openstack/nova/nova/api/openstack/servers.py", line 113, in detail
(nova.api.openstack): TRACE: return self._items(req, entity_maker=_translate_detail_keys)
(nova.api.openstack): TRACE: File "/root/openstack/nova/nova/api/openstack/servers.py", line 122, in _items
(nova.api.openstack): TRACE: res = [entity_maker(inst)['server'] for inst in limited_list]
(nova.api.openstack): TRACE: File "/root/openstack/nova/nova/api/openstack/servers.py", line 68, in _translate_detail_keys
(nova.api.openstack): TRACE: private_ip = inst['fixed_ip']['address']
(nova.api.openstack): TRACE: TypeError: 'NoneType' object is unsubscriptable
(nova.api.openstack): TRACE:

Related branches

Revision history for this message
Antony Messerli (antonym) wrote :

Appears to be related to code introduced in rev 692 (Update the Openstack API so that it returns 'addresses'.)

Dan Prince (dan-prince)
Changed in nova:
assignee: nobody → Dan Prince (dan-prince)
Revision history for this message
Dan Prince (dan-prince) wrote :

The attached patch should resolve this issue.

Revision history for this message
Antony Messerli (antonym) wrote :

Tested it out and it appears to have resolved the error.

Changed in nova:
status: New → Fix Committed
Dan Prince (dan-prince)
Changed in nova:
status: Fix Committed → In Progress
Thierry Carrez (ttx)
Changed in nova:
importance: Undecided → Medium
Revision history for this message
Dan Prince (dan-prince) wrote :

A fix for this has long since been commited. The solution was to use utils.get_from_path which doesn't throw an exception if the key at the specified path is missing.

Should be good to go. Marking as fixed.

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → 2011.2
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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