Fix scheduling algorithm for KaaS jobs
Change-Id: I35039e9371712c1e3043e57e8944789bcc3c0628
diff --git a/src/com/mirantis/mk/KaasUtils.groovy b/src/com/mirantis/mk/KaasUtils.groovy
index b496e6f..e78921c 100644
--- a/src/com/mirantis/mk/KaasUtils.groovy
+++ b/src/com/mirantis/mk/KaasUtils.groovy
@@ -1242,7 +1242,8 @@
while (!freeNodes) {
freeNodes = jenkins.model.Jenkins.instance.computers.findAll { node ->
label in node.getAssignedLabels().collect { it.name } &&
- node.isPartiallyIdle()
+ node.isPartiallyIdle() &&
+ node.isOnline()
}
if (!freeNodes) {
echo 'No nodes available for scheduling, retrying...'