ucloud-vm/config.py

31 lines
769 B
Python
Raw Normal View History

2019-09-03 16:18:43 +00:00
import logging
from etcd3_wrapper import Etcd3Wrapper
from ucloud_common.vm import VmPool
from ucloud_common.host import HostPool
from ucloud_common.request import RequestPool
from decouple import config
WITHOUT_CEPH = config("WITHOUT_CEPH", False, cast=bool)
2019-09-03 16:18:43 +00:00
logging.basicConfig(
level=logging.DEBUG,
filename="log.txt",
filemode="a",
format="%(asctime)s: %(levelname)s - %(message)s",
datefmt="%d-%b-%y %H:%M:%S",
)
etcd_client = Etcd3Wrapper(host=config("ETCD_URL"))
2019-09-13 11:26:26 +00:00
HOST_PREFIX = config("HOST_PREFIX")
VM_PREFIX = config("VM_PREFIX")
REQUEST_PREFIX = config("REQUEST_PREFIX")
host_pool = HostPool(etcd_client, HOST_PREFIX)
vm_pool = VmPool(etcd_client, VM_PREFIX)
request_pool = RequestPool(etcd_client, REQUEST_PREFIX)
2019-09-03 16:18:43 +00:00
running_vms = []