Merge "sort ctl and proxy nodes"
diff --git a/openstack-control-upgrade.groovy b/openstack-control-upgrade.groovy
index bbeb15a..13b3bec 100644
--- a/openstack-control-upgrade.groovy
+++ b/openstack-control-upgrade.groovy
@@ -44,10 +44,8 @@
                 common.warningMsg("No response from some minions. We should continue to run")
             }
 
-            def _pillar = salt.getGrain(pepperEnv, 'I@salt:master', 'domain')
-            def domain = _pillar['return'][0].values()[0].values()[0]
-            print(_pillar)
-            print(domain)
+            def domain = salt.getPillar(pepperEnv, 'I@salt:master', '_param:cluster_domain')
+            domain = domain['return'][0].values()[0]
 
             // read backupninja variable
             _pillar = salt.getPillar(pepperEnv, 'I@backupninja:client', '_param:backupninja_backup_host')
@@ -209,10 +207,8 @@
         stage('Real upgrade') {
             // # actual upgrade
 
-            _pillar = salt.getGrain(pepperEnv, 'I@salt:master', 'domain')
-            domain = _pillar['return'][0].values()[0].values()[0]
-            print(_pillar)
-            print(domain)
+            def domain = salt.getPillar(pepperEnv, 'I@salt:master', '_param:cluster_domain')
+            domain = domain['return'][0].values()[0]
 
             _pillar = salt.getGrain(pepperEnv, 'I@salt:control', 'id')
             kvm01 = _pillar['return'][0].values()[0].values()[0]
@@ -278,12 +274,12 @@
             for (t in control_target_hosts) {
                 def target = t.split("\\.")[0]
                 // wait until ctl and prx nodes are registered in salt-key
-                salt.minionPresent(pepperEnv, 'I@salt:master', '${target}')
+                salt.minionPresent(pepperEnv, 'I@salt:master', "${target}")
             }
             for (t in proxy_target_hosts) {
                 def target = t.split("\\.")[0]
                 // wait until ctl and prx nodes are registered in salt-key
-                salt.minionPresent(pepperEnv, 'I@salt:master', '${target}')
+                salt.minionPresent(pepperEnv, 'I@salt:master', "${target}")
             }
 
             // salt '*' saltutil.refresh_pillar
@@ -360,6 +356,7 @@
 
             } catch (Exception e) {
                 errorOccured = true
+                input message: "Some states that require syncdb failed. Please check the reason and click proceed only if you want to restore database into it's pre-upgrade state. Otherwise, click abort."
                 common.warningMsg('Some states that require syncdb failed. Restoring production databases')
 
                 // database restore section
@@ -481,10 +478,8 @@
                 input message: "Do you really want to continue with the rollback?"
             }
 
-            _pillar = salt.getGrain(pepperEnv, 'I@salt:master', 'domain')
-            domain = _pillar['return'][0].values()[0].values()[0]
-            print(_pillar)
-            print(domain)
+            def domain = salt.getPillar(pepperEnv, 'I@salt:master', '_param:cluster_domain')
+            domain = domain['return'][0].values()[0]
 
             _pillar = salt.getGrain(pepperEnv, 'I@salt:control', 'id')
             kvm01 = _pillar['return'][0].values()[0].values()[0]
diff --git a/test-salt-models-pipeline.groovy b/test-salt-models-pipeline.groovy
index c931e60..fcfba0c 100644
--- a/test-salt-models-pipeline.groovy
+++ b/test-salt-models-pipeline.groovy
@@ -136,6 +136,10 @@
       }
     }
 
+    stage("Check YAML") {
+       sh("git diff-tree --no-commit-id --diff-filter=d --name-only -r HEAD  | grep .yml | xargs -I {}  python -c \"import yaml; yaml.load(open('{}', 'r'))\" \\;")
+    }
+
     stage("test-nodes") {
       if(checkouted) {
         def modifiedClusters = null
diff --git a/test-system-reclass-pipeline.groovy b/test-system-reclass-pipeline.groovy
index 03bd9fe..49755bc 100644
--- a/test-system-reclass-pipeline.groovy
+++ b/test-system-reclass-pipeline.groovy
@@ -58,6 +58,8 @@
             documentationOnly = sh(script: "git diff-tree --no-commit-id --name-only -r HEAD | grep -v .releasenotes", returnStatus: true) == 1
           }
 
+          sh("git diff-tree --no-commit-id --diff-filter=d --name-only -r HEAD  | grep .yml | xargs -I {}  python -c \"import yaml; yaml.load(open('{}', 'r'))\" \\;")
+
           def branches = [:]
           def testModels = documentationOnly ? [] : TEST_MODELS.split(',')
             for (int i = 0; i < testModels.size(); i++) {