forked from uncloud/uncloud
1. mp.set_start_method('spawn') commented out from scripts/uncloud
2. uncloud.shared moved under uncloud.common
3. Refactoring in etcd_wrapper e.g timeout mechanism removed and few other things
4. uncloud-{scheduler,host} now better handle etcd events in their block state (waiting for requests to come)
This commit is contained in:
parent
f8f790e7fc
commit
48efcdf08c
17 changed files with 136 additions and 173 deletions
34
uncloud/common/shared.py
Normal file
34
uncloud/common/shared.py
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
from uncloud.common.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()
|
||||
Loading…
Add table
Add a link
Reference in a new issue