Ceph remove pipeline refactorings
Change-Id: I7a3f025158d609e0e975471d949fdff30a719621
diff --git a/ceph-remove-osd.groovy b/ceph-remove-osd.groovy
index 04a176b..71946b7 100644
--- a/ceph-remove-osd.groovy
+++ b/ceph-remove-osd.groovy
@@ -75,7 +75,11 @@
// get list of osd disks of the host
salt.runSaltProcessStep(pepperEnv, HOST, 'saltutil.sync_grains', [], null, true, 5)
- def ceph_disks = salt.getGrain(pepperEnv, HOST, 'ceph')['return'][0].values()[0].values()[0]['ceph_disk']
+ def cephGrain = salt.getGrain(pepperEnv, HOST, 'ceph')['return']
+ if(cephGrain['return'].isEmpty()){
+ throw new Exception("Ceph salt grain cannot be found!")
+ }
+ def ceph_disks = cephGrain['return'][0].values()[0].values()[0]['ceph_disk']
common.prettyPrint(ceph_disks)
for (i in ceph_disks) {
@@ -89,7 +93,7 @@
}
// wait for healthy cluster
- if (WAIT_FOR_HEALTHY.toBoolean() == true) {
+ if (WAIT_FOR_HEALTHY.toBoolean()) {
waitForHealthy(pepperEnv)
}
@@ -99,7 +103,7 @@
}
// wait for healthy cluster
- if (WAIT_FOR_HEALTHY.toBoolean() == true) {
+ if (WAIT_FOR_HEALTHY.toBoolean()) {
sleep(5)
waitForHealthy(pepperEnv)
}