Browse Source

Merge "Build different etcd client depending protocol"

changes/06/673506/1
Zuul 2 years ago
committed by Gerrit Code Review
parent
commit
32a68d1bfc
  1. 17
      qinling/utils/etcd_util.py

17
qinling/utils/etcd_util.py

@ -24,12 +24,17 @@ def get_client(conf=None):
conf = conf or CONF
if not CLIENT:
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)
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

Loading…
Cancel
Save