replaced hardcoded "ceph_disk" literal with variable based on the lvm_enabled pillar
Change-Id: I479ab9832961c4c5e012e661bdd06604ecfed638
Related-Prod: PROD-34370
diff --git a/cloud-update.groovy b/cloud-update.groovy
index 9945d33..f45e4ec 100644
--- a/cloud-update.groovy
+++ b/cloud-update.groovy
@@ -897,6 +897,7 @@
def salt = new com.mirantis.mk.Salt()
def common = new com.mirantis.mk.Common()
def targetHosts = salt.getMinionsSorted(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 (t in targetHosts) {
def osd_ids = []
// get list of osd disks of the host
@@ -906,7 +907,7 @@
throw new Exception("Ceph salt grain cannot be found!")
}
common.print(cephGrain)
- def ceph_disks = cephGrain['return'][0].values()[0].values()[0]['ceph_disk']
+ def ceph_disks = cephGrain['return'][0].values()[0].values()[0][device_grain_name]
for (i in ceph_disks) {
def osd_id = i.getKey().toString()
osd_ids.add('osd.' + osd_id)