25 lines
598 B
Python
25 lines
598 B
Python
|
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
|
||
|
|
||
|
|
||
|
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"))
|
||
|
|
||
|
host_pool = HostPool(etcd_client, "/v1/host")
|
||
|
vm_pool = VmPool(etcd_client, "/v1/vm")
|
||
|
request_pool = RequestPool(etcd_client, "/v1/request")
|
||
|
|
||
|
running_vms = []
|