Merge "Fix scheduling algorithm for KaaS jobs"
diff --git a/src/com/mirantis/mk/KaasUtils.groovy b/src/com/mirantis/mk/KaasUtils.groovy
index 1710ca6..5a67005 100644
--- a/src/com/mirantis/mk/KaasUtils.groovy
+++ b/src/com/mirantis/mk/KaasUtils.groovy
@@ -1294,7 +1294,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...'