From e7ea06aff17b3c05c71be0039784bf2047144687 Mon Sep 17 00:00:00 2001 From: meow Date: Wed, 27 Nov 2019 13:04:57 +0500 Subject: [PATCH] works with secure/production level etcd clusters now --- config.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/config.py b/config.py index 39fc7f7..838af89 100644 --- a/config.py +++ b/config.py @@ -1,4 +1,15 @@ from etcd3_wrapper import Etcd3Wrapper -from decouple import config +import decouple -etcd_client = Etcd3Wrapper() +__ETCD_HOST = decouple.config("ETCD_HOST", None) +__ETCD_PORT = decouple.config("ETCD_PORT", None) +__CA_CERT = decouple.config("CA_CERT", None) +__CERT_CERT = decouple.config("CERT_CERT", None) +__CERT_KEY = decouple.config("CERT_KEY", None) + +if __ETCD_HOST and __ETCD_PORT and __CA_CERT and __CERT_CERT and __CERT_KEY: + etcd_client = Etcd3Wrapper(host=__ETCD_HOST, port=__ETCD_PORT, + ca_cert=__CA_CERT, cert_cert=__CERT_CERT, + cert_key=__CERT_KEY) +else: + etcd_client = Etcd3Wrapper()