diff options
| author | Chris Behrens <cbehrens@codestud.com> | 2011-08-30 15:12:43 -0700 |
|---|---|---|
| committer | Chris Behrens <cbehrens@codestud.com> | 2011-08-30 15:12:43 -0700 |
| commit | 4ec4ddd2e6465f0483ecf50d430458169ad4c348 (patch) | |
| tree | 9ef878f434373ce66aea95fe1386228f488ab274 | |
| parent | b6c306b1a207fd2c5ee2e53d841fd8e60c2fd8e1 (diff) | |
make default carrot again and delay the import in rpc/__init__.py
| -rw-r--r-- | nova/rpc/__init__.py | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/nova/rpc/__init__.py b/nova/rpc/__init__.py index 4f57a345d..32509fff6 100644 --- a/nova/rpc/__init__.py +++ b/nova/rpc/__init__.py @@ -23,27 +23,33 @@ from nova import flags FLAGS = flags.FLAGS flags.DEFINE_string('rpc_backend', - 'nova.rpc.impl_kombu', - "The messaging module to use, defaults to kombu.") + 'nova.rpc.impl_carrot', + "The messaging module to use, defaults to carrot.") -RPCIMPL = import_object(FLAGS.rpc_backend) +_RPCIMPL = None + +def get_impl(): + global _RPCIMPL + if _RPCIMPL is None: + _RPCIMPL = import_object(FLAGS.rpc_backend) + return _RPCIMPL def create_connection(new=True): - return RPCIMPL.create_connection(new=new) + return get_impl().create_connection(new=new) def call(context, topic, msg): - return RPCIMPL.call(context, topic, msg) + return get_impl().call(context, topic, msg) def cast(context, topic, msg): - return RPCIMPL.cast(context, topic, msg) + return get_impl().cast(context, topic, msg) def fanout_cast(context, topic, msg): - return RPCIMPL.fanout_cast(context, topic, msg) + return get_impl().fanout_cast(context, topic, msg) def multicall(context, topic, msg): - return RPCIMPL.multicall(context, topic, msg) + return get_impl().multicall(context, topic, msg) |
