utils.to_primitive still tripping up on some objects ...

Bug #829624 reported by Sandy Walsh
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Sandy Walsh

Bug Description

Recent changes were made to utils/to_primitive to support classes/instances, but json still trips up over things like built-ins, modules, etc.

Related branches

Thierry Carrez (ttx)
Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → diablo-4
Changed in nova:
status: Fix Committed → Incomplete
Revision history for this message
Sandy Walsh (sandy-walsh) wrote :
Download full text (4.9 KiB)

Seems like "all" is causing grief, although it is handled by inspect.isbuiltin()

I think the "ERROR" part of this trace is a different issue.

2011-08-27 03:05:24,701 ERROR nova.exception [-] Problem '<built-in function all> is not JSON serializable' attempting to send to notification system.
(nova.exception): TRACE: Traceback (most recent call last):
(nova.exception): TRACE: File "/usr/lib/pymodules/python2.6/nova/notifier/api.py", line 95, in notify
(nova.exception): TRACE: driver.notify(msg)
(nova.exception): TRACE: File "/usr/lib/pymodules/python2.6/nova/notifier/rabbit_notifier.py", line 36, in notify
(nova.exception): TRACE: rpc.cast(context, topic, message)
(nova.exception): TRACE: File "/usr/lib/pymodules/python2.6/nova/rpc/__init__.py", line 58, in cast
(nova.exception): TRACE: return RPCIMPL.cast(context, topic, msg)
(nova.exception): TRACE: File "/usr/lib/pymodules/python2.6/nova/rpc/amqp.py", line 539, in cast
(nova.exception): TRACE: publisher.send(msg)
(nova.exception): TRACE: File "/usr/lib/pymodules/python2.6/carrot/messaging.py", line 758, in send
(nova.exception): TRACE: serializer=serializer)
(nova.exception): TRACE: File "/usr/lib/pymodules/python2.6/carrot/messaging.py", line 687, in create_message
(nova.exception): TRACE: serializer=serializer)
(nova.exception): TRACE: File "/usr/lib/pymodules/python2.6/carrot/serialization.py", line 144, in encode
(nova.exception): TRACE: payload = encoder(data)
(nova.exception): TRACE: File "/usr/lib/pymodules/python2.6/anyjson/__init__.py", line 123, in <lambda>
(nova.exception): TRACE: serialize = lambda value: implementation.serialize(value)
(nova.exception): TRACE: File "/usr/lib/pymodules/python2.6/anyjson/__init__.py", line 85, in serialize
(nova.exception): TRACE: raise TypeError(*exc.args)
(nova.exception): TRACE: TypeError: <built-in function all> is not JSON serializable
(nova.exception): TRACE:
2011-08-27 03:05:24,760 ERROR nova [-] Exception during message handling
(nova): TRACE: Traceback (most recent call last):
(nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/rpc/amqp.py", line 230, in _process_data
(nova): TRACE: rval = node_func(context=ctxt, **node_args)
(nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/exception.py", line 98, in wrapped
(nova): TRACE: return f(*args, **kw)
(nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/compute/manager.py", line 459, in run_instance
(nova): TRACE: self._run_instance(context, instance_id, **kwargs)
(nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/compute/manager.py", line 414, in _run_instance
(nova): TRACE: instance, vpn=is_vpn)
(nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/network/api.py", line 156, in allocate_for_instance
(nova): TRACE: 'args': args})
(nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/rpc/__init__.py", line 54, in call
(nova): TRACE: return RPCIMPL.call(context, topic, msg)
(nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/rpc/amqp.py", line 527, in call
(nova): TRACE: rv = list(rv)
(nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/rpc/amqp.py", line 516, in wait
(nova)...

Read more...

Changed in nova:
status: Incomplete → In Progress
Thierry Carrez (ttx)
Changed in nova:
status: In Progress → Fix Committed
milestone: diablo-4 → diablo-rbp
Thierry Carrez (ttx)
Changed in nova:
milestone: diablo-rbp → 2011.3
status: Fix Committed → Fix Released
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.