2019-10-25 06:42:40 +00:00
|
|
|
import logging
|
|
|
|
|
|
|
|
from etcd3_wrapper import Etcd3Wrapper
|
|
|
|
from decouple import config
|
|
|
|
|
|
|
|
from ucloud_common.vm import VmPool
|
|
|
|
|
|
|
|
logging.basicConfig(
|
|
|
|
level=logging.DEBUG,
|
|
|
|
filename="log.txt",
|
|
|
|
filemode="a",
|
|
|
|
format="%(asctime)s: %(levelname)s - %(message)s",
|
|
|
|
datefmt="%d-%b-%y %H:%M:%S",
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
VM_PREFIX = config("VM_PREFIX")
|
2019-11-02 15:42:24 +00:00
|
|
|
USER_PREFIX = config("USER_PREFIX")
|
2019-10-25 06:42:40 +00:00
|
|
|
|
|
|
|
etcd_client = Etcd3Wrapper(host=config("ETCD_URL"))
|
|
|
|
|
|
|
|
VM_POOL = VmPool(etcd_client, VM_PREFIX)
|