コード例 #1
0
 def __init__(self, arguments):
     self.host = arguments.get('host', self.DEFAULT_HOST)
     self.port = arguments.get('port', self.DEFAULT_PORT)
     self.timeout = int(arguments.get('timeout', self.DEFAULT_TIMEOUT))
     self._client = etcd3gw.client(host=self.host,
                                   port=self.port,
                                   timeout=self.timeout)
コード例 #2
0
ファイル: etcd_util.py プロジェクト: baikai/qinling
def get_client(conf=None):
    global CLIENT
    conf = conf or CONF

    if not CLIENT:
        CLIENT = etcd3gw.client(host=conf.etcd.host, port=conf.etcd.port)

    return CLIENT
コード例 #3
0
ファイル: etcd_util.py プロジェクト: goldyfruit/qinling
def get_client(conf=None):
    global CLIENT
    conf = conf or CONF

    if not CLIENT:
        if conf.etcd.protocol == "https":
            CLIENT = etcd3gw.client(host=conf.etcd.host,
                                    port=conf.etcd.port,
                                    protocol=conf.etcd.protocol,
                                    ca_cert=conf.etcd.ca_cert,
                                    cert_cert=conf.etcd.cert_file,
                                    cert_key=conf.etcd.cert_key)
        else:
            CLIENT = etcd3gw.client(host=conf.etcd.host,
                                    port=conf.etcd.port,
                                    protocol=conf.etcd.protocol)

    return CLIENT
コード例 #4
0
ファイル: etcd3gw.py プロジェクト: openstack/oslo.cache
 def __init__(self, arguments):
     self.host = arguments.get('host', self.DEFAULT_HOST)
     self.port = arguments.get('port', self.DEFAULT_PORT)
     self.timeout = int(arguments.get('timeout', self.DEFAULT_TIMEOUT))
     # module etcd3gw is only required when etcd3gw backend is used
     import etcd3gw
     self._client = etcd3gw.client(host=self.host,
                                   port=self.port,
                                   timeout=self.timeout)
コード例 #5
0
ファイル: etcd3gw.py プロジェクト: Kami/tooz
 def __init__(self, member_id, parsed_url, options):
     super(Etcd3Driver, self).__init__(member_id, parsed_url, options)
     host = parsed_url.hostname or self.DEFAULT_HOST
     port = parsed_url.port or self.DEFAULT_PORT
     options = utils.collapse(options)
     timeout = int(options.get('timeout', self.DEFAULT_TIMEOUT))
     self.client = etcd3gw.client(host=host, port=port, timeout=timeout)
     self.lock_timeout = int(options.get('lock_timeout', timeout))
     self.membership_timeout = int(options.get(
         'membership_timeout', timeout))
     self._acquired_locks = set()
コード例 #6
0
ファイル: etcd3gw.py プロジェクト: openstack/tooz
 def __init__(self, member_id, parsed_url, options):
     super(Etcd3Driver, self).__init__(member_id, parsed_url, options)
     host = parsed_url.hostname or self.DEFAULT_HOST
     port = parsed_url.port or self.DEFAULT_PORT
     options = utils.collapse(options)
     timeout = int(options.get('timeout', self.DEFAULT_TIMEOUT))
     self.client = etcd3gw.client(host=host, port=port, timeout=timeout)
     self.lock_timeout = int(options.get('lock_timeout', timeout))
     self.membership_timeout = int(options.get(
         'membership_timeout', timeout))
     self._acquired_locks = set()
コード例 #7
0
ファイル: etcd3gw.py プロジェクト: BoTranVan/tooz
 def __init__(self, member_id, parsed_url, options):
     super(Etcd3Driver, self).__init__(member_id, parsed_url, options)
     protocol = 'https' if parsed_url.scheme.endswith('https') else 'http'
     host = parsed_url.hostname or self.DEFAULT_HOST
     port = parsed_url.port or self.DEFAULT_PORT
     options = utils.collapse(options)
     ca_cert = options.get('ca_cert')
     cert_key = options.get('cert_key')
     cert_cert = options.get('cert_cert')
     timeout = int(options.get('timeout', self.DEFAULT_TIMEOUT))
     self.client = etcd3gw.client(host=host,
                                  port=port,
                                  protocol=protocol,
                                  ca_cert=ca_cert,
                                  cert_key=cert_key,
                                  cert_cert=cert_cert,
                                  timeout=timeout)
     self.lock_timeout = int(options.get('lock_timeout', timeout))
     self.membership_timeout = int(
         options.get('membership_timeout', timeout))
     self._acquired_locks = set()
コード例 #8
0
ファイル: etcd_db_driver.py プロジェクト: gampel/dragonflow
 def initialize(self, db_ip, db_port, **args):
     self.client = etcd.client(host=db_ip, port=db_port)
コード例 #9
0
 def initialize(self, callback):
     self.db_changes_callback = callback
     self.stop_event = threading.Event()
     ip, port = api_nb.get_db_ip_port()
     self.client = etcd3gw.client(host=ip, port=port)
コード例 #10
0
 def initialize(self):
     super(EtcdPublisherAgent, self).__init__()
     ip, port = api_nb.get_db_ip_port()
     self.client = etcd3gw.client(host=ip, port=port)
コード例 #11
0
ファイル: etcd_db_driver.py プロジェクト: anlaneg/dragonflow
 def initialize(self, db_ip, db_port, **args):
     #初始化db client(采用etcd进行存储)
     self.client = etcd.client(host=db_ip, port=db_port)
コード例 #12
0
 def initialize(self, callback):
     self.db_changes_callback = callback
     self.stop_event = threading.Event()
     self.client = etcd3gw.client(host=cfg.CONF.df.remote_db_ip,
                                  port=cfg.CONF.df.remote_db_port)
コード例 #13
0
 def initialize(self):
     super(EtcdPublisherAgent, self).__init__()
     self.client = etcd3gw.client(host=cfg.CONF.df.remote_db_ip,
                                  port=cfg.CONF.df.remote_db_port)