uotp/config.py

16 lines
604 B
Python
Raw Normal View History

2019-10-07 17:13:42 +00:00
from etcd3_wrapper import Etcd3Wrapper
import decouple
2019-10-07 17:13:42 +00:00
__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()