~ubuntu-branches/ubuntu/quantal/nova/quantal-proposed

« back to all changes in this revision

Viewing changes to nova/rpc/impl_carrot.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-01-20 11:54:15 UTC
  • mto: This revision was merged to the branch mainline in revision 62.
  • Revision ID: package-import@ubuntu.com-20120120115415-h2ujma9o536o1ut6
Tags: upstream-2012.1~e3~20120120.12170
ImportĀ upstreamĀ versionĀ 2012.1~e3~20120120.12170

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
from nova import context
43
43
from nova import exception
44
44
from nova import flags
 
45
from nova import local
45
46
from nova.rpc import common as rpc_common
46
47
from nova.rpc.common import RemoteError, LOG
47
48
from nova.testing import fake
253
254
        Example: {'method': 'echo', 'args': {'value': 42}}
254
255
 
255
256
        """
 
257
        # It is important to clear the context here, because at this point
 
258
        # the previous context is stored in local.store.context
 
259
        if hasattr(local.store, 'context'):
 
260
            del local.store.context
256
261
        LOG.debug(_('received %s') % message_data)
257
262
        # This will be popped off in _unpack_context
258
263
        msg_id = message_data.get('_msg_id', None)
485
490
            value = msg.pop(key)
486
491
            context_dict[key[9:]] = value
487
492
    context_dict['msg_id'] = msg.pop('_msg_id', None)
488
 
    LOG.debug(_('unpacked context: %s'), context_dict)
489
 
    return RpcContext.from_dict(context_dict)
 
493
    ctx = RpcContext.from_dict(context_dict)
 
494
    LOG.debug(_('unpacked context: %s'), ctx.to_dict())
 
495
    return ctx
490
496
 
491
497
 
492
498
def _pack_context(msg, context):