Browse Source

Build different etcd client depending protocol

etcd should not looking for TLS certificates when http protocol
is used.

Change-Id: I91122cc56bf1f11be1700d09ff03cdff15badf91
Story: 2005935
Task: 34281
changes/35/666935/3
Gaëtan Trellu 2 years ago
parent
commit
adba9605ac
1 changed files with 11 additions and 6 deletions
  1. +11
    -6
      qinling/utils/etcd_util.py

+ 11
- 6
qinling/utils/etcd_util.py View File

@ -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