[scheduler] helper.py refactored from env_vars to config

This commit is contained in:
llnu 2019-12-08 13:31:56 +01:00
parent 787b236305
commit dd33b89941
1 changed files with 2 additions and 2 deletions

View File

@ -6,7 +6,7 @@ import bitmath
from ucloud.common.host import HostStatus
from ucloud.common.request import RequestEntry, RequestType
from ucloud.common.vm import VMStatus
from ucloud.config import vm_pool, host_pool, request_pool, env_vars
from ucloud.config import vm_pool, host_pool, request_pool, config
def accumulated_specs(vms_specs):
@ -106,7 +106,7 @@ def assign_host(vm):
r = RequestEntry.from_scratch(type=RequestType.StartVM,
uuid=vm.uuid,
hostname=vm.hostname,
request_prefix=env_vars.get("REQUEST_PREFIX"))
request_prefix=config['etcd']['REQUEST_PREFIX'])
request_pool.put(r)
vm.log.append("VM scheduled for starting")