|
|
@@ -1,17 +1,29 @@
|
|
|
# Copyright 2016 Cloudbase Solutions Srl
|
|
|
# All Rights Reserved.
|
|
|
|
|
|
+from oslo_config import cfg
|
|
|
import oslo_messaging as messaging
|
|
|
|
|
|
from coriolis import rpc
|
|
|
|
|
|
VERSION = "1.0"
|
|
|
|
|
|
+conductor_opts = [
|
|
|
+ cfg.IntOpt("conductor_rpc_timeout",
|
|
|
+ help="Number of seconds until RPC calls to the "
|
|
|
+ "conductor timeout.")
|
|
|
+]
|
|
|
+
|
|
|
+CONF = cfg.CONF
|
|
|
+CONF.register_opts(conductor_opts, 'conductor')
|
|
|
+
|
|
|
|
|
|
class ConductorClient(object):
|
|
|
- def __init__(self):
|
|
|
+ def __init__(self, timeout=None):
|
|
|
target = messaging.Target(topic='coriolis_conductor', version=VERSION)
|
|
|
- self._client = rpc.get_client(target)
|
|
|
+ if timeout is None:
|
|
|
+ timeout = CONF.conductor.conductor_rpc_timeout
|
|
|
+ self._client = rpc.get_client(target, timeout=timeout)
|
|
|
|
|
|
def create_endpoint(self, ctxt, name, endpoint_type, description,
|
|
|
connection_info):
|