remove ceph osd pipeline - fix partition removal while using nvme drives
Change-Id: I8fd217e7bb2a573c3482e99769e587d0a5cf9a8f
Related-Prod: PROD-32481
diff --git a/ceph-remove-osd.groovy b/ceph-remove-osd.groovy
index b89f3f2..098fb98 100644
--- a/ceph-remove-osd.groovy
+++ b/ceph-remove-osd.groovy
@@ -56,11 +56,22 @@
}
}
if (partition?.trim()) {
- // dev = /dev/sdi
- def dev = partition.replaceAll('\\d+$', "")
- // part_id = 2
- def part_id = partition.substring(partition.lastIndexOf("/")+1).replaceAll("[^0-9]+", "")
- runCephCommand(master, target, "Ignore | parted ${dev} rm ${part_id}")
+ if (partition.contains("nvme")) {
+ // dev = /dev/nvme1n1p1
+ def dev = partition.replaceAll('\\d+$', "")
+ print("Skipping " + dev)
+ // part_id = 2
+ def part_id = partition.substring(partition.lastIndexOf("p")+1).replaceAll("[^0-9]+", "")
+ print("Skipping" + part_id)
+ runCephCommand(master, target, "Ignore | parted ${dev} rm ${part_id}")
+ }
+ else {
+ // dev = /dev/sdi
+ def dev = partition.replaceAll('\\d+$', "")
+ // part_id = 2
+ def part_id = partition.substring(partition.lastIndexOf("/")+1).replaceAll("[^0-9]+", "")
+ runCephCommand(master, target, "Ignore | parted ${dev} rm ${part_id}")
+ }
}
return
}