From 1c16a83b354c1d53320a7396a6834b6f5858d71d Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Jun 18 2019 16:41:44 +0000 Subject: backend: really skip VMs with check failure This seems to be a bug which could cause weird things like "VM not responding", but still it was requested to do some task. Such task could fail without obvious reasons -- and the worst thing on this would be that Copr would blame the user for the mistake (failed build). --- diff --git a/backend/backend/vm_manage/manager.py b/backend/backend/vm_manage/manager.py index 8189e1f..82de9aa 100644 --- a/backend/backend/vm_manage/manager.py +++ b/backend/backend/vm_manage/manager.py @@ -243,8 +243,11 @@ class VmManager(object): available_vms += clean_list for vmd in available_vms: - if vmd.get_field(self.rc, "check_fails") != "0": + check_fails = vmd.get_field(self.rc, "check_fails") + if check_fails and check_fails != "0": self.log.debug("VM %s has check fails, skip acquire", vmd.vm_name) + continue + vm_key = KEY_VM_INSTANCE.format(vm_name=vmd.vm_name) if self.lua_scripts["acquire_vm"](keys=[vm_key, KEY_SERVER_INFO], args=[ownername, pid, time.time(),