2019-09-07 10:38:58 +00:00
|
|
|
import logging
|
|
|
|
|
2019-09-03 16:01:40 +00:00
|
|
|
from etcd3_wrapper import Etcd3Wrapper
|
|
|
|
from decouple import config
|
|
|
|
|
2019-09-22 18:51:33 +00:00
|
|
|
|
|
|
|
from ucloud_common.vm import VmPool
|
|
|
|
from ucloud_common.host import HostPool
|
|
|
|
from ucloud_common.request import RequestPool
|
|
|
|
|
2019-09-07 10:38:58 +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",
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
WITHOUT_CEPH = config("WITHOUT_CEPH", False, cast=bool)
|
2019-09-12 15:55:25 +00:00
|
|
|
VM_PREFIX = config("VM_PREFIX")
|
|
|
|
HOST_PREFIX = config("HOST_PREFIX")
|
|
|
|
REQUEST_PREFIX = config("REQUEST_PREFIX")
|
|
|
|
FILE_PREFIX = config("FILE_PREFIX")
|
|
|
|
IMAGE_PREFIX = config("IMAGE_PREFIX")
|
|
|
|
IMAGE_STORE_PREFIX = config("IMAGE_STORE_PREFIX")
|
2019-09-07 10:38:58 +00:00
|
|
|
|
2019-09-03 16:01:40 +00:00
|
|
|
etcd_client = Etcd3Wrapper(host=config("ETCD_URL"))
|
2019-09-22 18:51:33 +00:00
|
|
|
|
|
|
|
VM_POOL = VmPool(etcd_client, VM_PREFIX)
|
|
|
|
HOST_POOL = HostPool(etcd_client, HOST_PREFIX)
|
|
|
|
REQUEST_POOL = RequestPool(etcd_client, REQUEST_PREFIX)
|