[ceph] fix issue with upmap used for adding missing osd
Related-Prod: PROD-36764
Change-Id: I3f8d0a4b9fb9d4f5e320e26b758e4ccb6db40b75
diff --git a/ceph-add-node.groovy b/ceph-add-node.groovy
index d1315b2..50fc876 100644
--- a/ceph-add-node.groovy
+++ b/ceph-add-node.groovy
@@ -118,20 +118,21 @@
if(useUpmap) {
stage("update mappings") {
- def mapping = []
def pgmap
for (int x = 1; x <= 3; x++) {
pgmap = ceph.cmdRun(pepperEnv, 'ceph pg ls remapped --format=json', false)
if (pgmap.trim()) {
pgmap = "{\"pgs\":$pgmap}" // common.parseJSON() can't parse a list of maps
pgmap = common.parseJSON(pgmap)['pgs']
- if (!pgmap.get('pg_ready', false)) {
- ceph.generateMapping(pgmap, mapping)
- for(map in mapping) {
- ceph.cmdRun(pepperEnv, map)
- }
- sleep(30)
+ if (pgmap instanceof java.util.Map && pgmap.get('pg_ready', false)) {
+ continue
}
+ def mapping = []
+ ceph.generateMapping(pgmap, mapping)
+ for(map in mapping) {
+ ceph.cmdRun(pepperEnv, map)
+ }
+ sleep(30)
}
}
}
diff --git a/ceph-remove-node.groovy b/ceph-remove-node.groovy
index d8a6d0e..7c2a25b 100644
--- a/ceph-remove-node.groovy
+++ b/ceph-remove-node.groovy
@@ -108,7 +108,8 @@
common.infoMsg("The following osds will be removed: ${osds.join(', ')}")
}
if(osds != cephDisks) {
- common.infoMsg("The following osds will be skiped: ${cephDisks.removeAll(osds).join(', ')}")
+ cephDisks.removeAll(osds)
+ common.infoMsg("The following osds will be skiped: ${cephDisks.join(', ')}")
}
ceph.removeOsd(pepperEnv, HOST, osds, flags, safeRemove, fullWipe)