replaced hardcoded "ceph_disk" literal with variable based on the lvm_enabled pillar
Change-Id: I479ab9832961c4c5e012e661bdd06604ecfed638
Related-Prod: PROD-34370
(cherry picked from commit 12955c759f0f53b00c76af2e2798433e7705582b)
diff --git a/ceph-backend-migration.groovy b/ceph-backend-migration.groovy
index 676c236..a9bf720 100644
--- a/ceph-backend-migration.groovy
+++ b/ceph-backend-migration.groovy
@@ -91,13 +91,13 @@
}
def target_hosts = salt.getMinions(pepperEnv, TARGET)
-
+ def device_grain_name = salt.getPillar(pepperEnv,"I@ceph:osd","ceph:osd:lvm_enabled")['return'].first().containsValue(true) ? "ceph_volume" : "ceph_disk"
for (tgt in target_hosts) {
def osd_ids = []
// get list of osd disks of the tgt
salt.runSaltProcessStep(pepperEnv, tgt, 'saltutil.sync_grains', [], null, true, 5)
- def ceph_disks = salt.getGrain(pepperEnv, tgt, 'ceph')['return'][0].values()[0].values()[0]['ceph_disk']
+ def ceph_disks = salt.getGrain(pepperEnv, tgt, 'ceph')['return'][0].values()[0].values()[0][device_grain_name]
for (i in ceph_disks) {
def osd_id = i.getKey().toString()