Migrate sanity_check.py into the respective daemons

This commit is contained in:
Nico Schottelius 2019-12-07 14:25:21 +01:00
commit 9517e73233
4 changed files with 22 additions and 35 deletions

View file

@ -71,8 +71,17 @@ def maintenance(host):
if _vm:
running_vms.remove(_vm)
def check():
if env_vars.get('STORAGE_BACKEND') == 'filesystem' and not isdir(env_vars.get('VM_DIR')):
print("You have set STORAGE_BACKEND to filesystem. So, the vm directory mentioned"
" in .env file must exists. But, it don't.")
sys.exit(1)
def main(hostname):
check()
heartbeat_updating_process = mp.Process(target=update_heartbeat, args=(hostname,))
host_pool = HostPool(etcd_client, env_vars.get('HOST_PREFIX'))