Fix Jenkins verifications for compute-node provisioning

Change-Id: Iaedd80577fd3607da9df0b00259986dba1a3cfa5
(cherry picked from commit 4e0c2ede8552a7fcbf0ceecd98f0cc9998d7919f)
diff --git a/Jenkinsfile b/Jenkinsfile
index f41b31f..4c542b7 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -113,19 +113,15 @@
                     }
                 }
 
-                stage ("Wait for computes nodes to be provisioned") {
-                    ip = runCmd("${config.head.ip}",
-                                "${config.head.user}",
-                                "${config.head.pass}",
-                                "docker inspect --format '{{.NetworkSettings.Networks.maas_default.IPAddress}}' provisioner").trim()
+                stage ("Wait for compute nodes to be provisioned") {
                     timeout(time:45) {
                         waitUntil {
                             try {
-                                out = runCmd("${config.head.ip}",
+                                num = runCmd("${config.head.ip}",
                                              "${config.head.user}",
                                              "${config.head.pass}",
-                                             "curl -sS http://$ip:4243/provision/ | jq -c \".[] | select(.status | contains(${config.compute_nodes.size()}))\"".trim())
-                                return out != ""
+                                             "cord prov list '|' grep -i node '|' grep -i complete '|' wc -l").trim()
+                                return num.toInteger() == config.compute_nodes.size()
                             } catch (exception) {
                                 return false
                             }