help='If passed, use a fake RabbitMQ provider'),
]
-_CONF = None
-
-
-def register_opts(conf):
- global _CONF
- _CONF = conf
- _CONF.register_opts(rpc_opts)
- _get_impl().register_opts(_CONF)
+cfg.CONF.register_opts(rpc_opts)
def create_connection(new=True):
:returns: An instance of cinder.rpc.common.Connection
"""
- return _get_impl().create_connection(_CONF, new=new)
+ return _get_impl().create_connection(cfg.CONF, new=new)
def call(context, topic, msg, timeout=None):
:raises: cinder.rpc.common.Timeout if a complete response is not received
before the timeout is reached.
"""
- return _get_impl().call(_CONF, context, topic, msg, timeout)
+ return _get_impl().call(cfg.CONF, context, topic, msg, timeout)
def cast(context, topic, msg):
:returns: None
"""
- return _get_impl().cast(_CONF, context, topic, msg)
+ return _get_impl().cast(cfg.CONF, context, topic, msg)
def fanout_cast(context, topic, msg):
:returns: None
"""
- return _get_impl().fanout_cast(_CONF, context, topic, msg)
+ return _get_impl().fanout_cast(cfg.CONF, context, topic, msg)
def multicall(context, topic, msg, timeout=None):
:raises: cinder.rpc.common.Timeout if a complete response is not received
before the timeout is reached.
"""
- return _get_impl().multicall(_CONF, context, topic, msg, timeout)
+ return _get_impl().multicall(cfg.CONF, context, topic, msg, timeout)
def notify(context, topic, msg):
:returns: None
"""
- return _get_impl().notify(_CONF, context, topic, msg)
+ return _get_impl().notify(cfg.CONF, context, topic, msg)
def cleanup():
:returns: None
"""
- return _get_impl().cast_to_server(_CONF, context, server_params, topic,
+ return _get_impl().cast_to_server(cfg.CONF, context, server_params, topic,
msg)
:returns: None
"""
- return _get_impl().fanout_cast_to_server(_CONF, context, server_params,
+ return _get_impl().fanout_cast_to_server(cfg.CONF, context, server_params,
topic, msg)
"""Delay import of rpc_backend until configuration is loaded."""
global _RPCIMPL
if _RPCIMPL is None:
- _RPCIMPL = importutils.import_module(_CONF.rpc_backend)
+ _RPCIMPL = importutils.import_module(cfg.CONF.rpc_backend)
return _RPCIMPL