meow
6fa77bce4d
Remove individual config.py used by every component and put them into single config.py ucloud/config.py Use /etc/ucloud/ucloud.conf for Environment Variables Refactoring and a lot of it Make ucloud repo a package and different components of ucloud a subpackage for avoiding code duplication. Improved logging.
19 lines
612 B
Python
19 lines
612 B
Python
from etcd3_wrapper import Etcd3Wrapper
|
|
|
|
from common.classes import EnvironmentVariables
|
|
from common.host import HostPool
|
|
from common.request import RequestPool
|
|
from common.vm import VmPool
|
|
|
|
env_vars = EnvironmentVariables('/etc/ucloud/ucloud.conf')
|
|
|
|
etcd_wrapper_args = ()
|
|
etcd_wrapper_kwargs = {"host": env_vars.get("ETCD_URL")}
|
|
|
|
etcd_client = Etcd3Wrapper(*etcd_wrapper_args, **etcd_wrapper_kwargs)
|
|
|
|
host_pool = HostPool(etcd_client, env_vars.get('HOST_PREFIX'))
|
|
vm_pool = VmPool(etcd_client, env_vars.get('VM_PREFIX'))
|
|
request_pool = RequestPool(etcd_client, env_vars.get('REQUEST_PREFIX'))
|
|
|
|
running_vms = []
|