Ceph - Add checks for host parameter
Related-Prod: PROD-35170
Change-Id: Ie19e1859e3bffa9814d24a9abff5b7a41b00ffd8
diff --git a/ceph-add-node.groovy b/ceph-add-node.groovy
index 9ec96c2..294f1ed 100644
--- a/ceph-add-node.groovy
+++ b/ceph-add-node.groovy
@@ -35,6 +35,12 @@
throw new InterruptedException()
}
+ def checknode = salt.runSaltProcessStep(pepperEnv, HOST, 'test.ping')
+ if (checknode['return'][0].values().isEmpty()) {
+ common.errorMsg("Host not found")
+ throw new InterruptedException()
+ }
+
if (HOST_TYPE.toLowerCase() != 'osd') {
// launch VMs
diff --git a/ceph-remove-node.groovy b/ceph-remove-node.groovy
index 55e9d6e..18b03fb 100644
--- a/ceph-remove-node.groovy
+++ b/ceph-remove-node.groovy
@@ -38,6 +38,12 @@
throw new InterruptedException()
}
+ def checknode = salt.runSaltProcessStep(pepperEnv, HOST, 'test.ping')
+ if (checknode['return'][0].values().isEmpty()) {
+ common.errorMsg("Host not found")
+ throw new InterruptedException()
+ }
+
stage('Refresh_pillar') {
salt.runSaltProcessStep(pepperEnv, '*', 'saltutil.refresh_pillar', [], null, true, 5)
}
diff --git a/ceph-remove-osd.groovy b/ceph-remove-osd.groovy
index 98c65a6..2788dcb 100644
--- a/ceph-remove-osd.groovy
+++ b/ceph-remove-osd.groovy
@@ -39,6 +39,12 @@
def osd_ids = []
+ def checknode = salt.runSaltProcessStep(pepperEnv, HOST, 'test.ping')
+ if (checknode['return'][0].values().isEmpty()) {
+ common.errorMsg("Host not found")
+ throw new InterruptedException()
+ }
+
// get list of osd disks of the host
salt.runSaltProcessStep(pepperEnv, HOST, 'saltutil.sync_grains', [], null, true, 5)
def cephGrain = salt.getGrain(pepperEnv, HOST, 'ceph')