From: Jonathan Rajotte Date: Thu, 16 Jul 2015 15:11:42 +0000 (-0400) Subject: Use more oo oriented function for queue fetching X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=5254a1ac01da7ba4cc04cd156f14fe560b9310fb;p=lttng-ci.git Use more oo oriented function for queue fetching --- diff --git a/dsl/kernel-lttng-modules.seed.groovy b/dsl/kernel-lttng-modules.seed.groovy index b551e16..86bf76d 100644 --- a/dsl/kernel-lttng-modules.seed.groovy +++ b/dsl/kernel-lttng-modules.seed.groovy @@ -248,6 +248,7 @@ if ( result.exitValue() == 0 ) { // Trigger generations def dslTriggerKernel = """\ import hudson.model.* +import jenkins.model.* import hudson.AbortException import hudson.console.HyperlinkNote import java.util.concurrent.CancellationException @@ -288,7 +289,7 @@ hudson.model.Hudson.instance.nodes.each { node -> println "Nb of live kernel enabled build node "+ kernelEnabledNode def ongoingBuild = [] -def queueInstance = Jenkins.instance.queue +def q = jenkins.model.Jenkins.getInstance().getQueue() while (toBuild.size() != 0) { @@ -296,7 +297,7 @@ while (toBuild.size() != 0) { def job = toBuild.pop() ongoingBuild.push(job.scheduleBuild2(0)) println "\\t trigering" + HyperlinkNote.encodeTo('/' + job.url, job.fullDisplayName) - println "Debug: currenlty queued task" + queueInstance.items.size() + println "Debug: currenlty queued task" + q.getItems().size() } else { Thread.sleep(random.nextInt(120000)) ongoingBuild.removeAll{ it.isCancelled() || it.isDone() }