Merge "unset flags even if pipeline failed with a exception"
diff --git a/ceph-upgrade.groovy b/ceph-upgrade.groovy
index 980c81c..c0a5636 100644
--- a/ceph-upgrade.groovy
+++ b/ceph-upgrade.groovy
@@ -27,11 +27,9 @@
 def python = new com.mirantis.mk.Python()
 ceph = new com.mirantis.mk.Ceph()
 
-def pepperEnv = "pepperEnv"
+pepperEnv = "pepperEnv"
 flags = CLUSTER_FLAGS.tokenize(',')
 
-def runHighState = RUNHIGHSTATE
-
 def backup(master, target) {
     stage("backup ${target}") {
 
@@ -124,9 +122,6 @@
                 }
 
                 ceph.waitForHealthy(master, ADMIN_HOST, flags)
-                if(runHighState) {
-                    salt.enforceHighstate(pepperEnv, tgt)
-                }
             }
 
             stage("Verify services for ${minion}") {
@@ -247,6 +242,11 @@
                 if (TARGET_RELEASE == 'nautilus' ) {
                     salt.cmdRun(pepperEnv, ADMIN_HOST, "ceph mon enable-msgr2")
                 }
+                if(RUNHIGHSTATE.toBoolean()) {
+                    salt.enforceHighstate(pepperEnv, "I@ceph:mon or I@ceph:mgr", '', false, true, 1)
+                    salt.enforceHighstate(pepperEnv, "I@ceph:radosgw", '', false, true, 1)
+                    salt.enforceHighstate(pepperEnv, "I@ceph:osd", '', false, true, 1)
+                }
             }
         }