uncloud-mravi/uncloud/shared/__init__.py
Nico Schottelius 433a3b9817 refactor #2
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
2019-12-31 11:30:02 +01:00

34 lines
821 B
Python

from uncloud.settings import settings
from uncloud.common.vm import VmPool
from uncloud.common.host import HostPool
from uncloud.common.request import RequestPool
from uncloud.common.storage_handlers import get_storage_handler
class Shared:
@property
def etcd_client(self):
return settings.get_etcd_client()
@property
def host_pool(self):
return HostPool(
self.etcd_client, settings["etcd"]["host_prefix"]
)
@property
def vm_pool(self):
return VmPool(self.etcd_client, settings["etcd"]["vm_prefix"])
@property
def request_pool(self):
return RequestPool(
self.etcd_client, settings["etcd"]["request_prefix"]
)
@property
def storage_handler(self):
return get_storage_handler()
shared = Shared()