Add support for cciss p seperator in ceph-osd fact
the facter code was subsituting the ! in the cciss device, but had forgotten about the p seperator between the device and partation number. the patch adds the p seperator if the ! is matched in the gsub to the remaining locations that would need the p seperator to properly refrence devices. Change-Id: I5054cde345495b62fa66f3ae3876fc6eb098cc5c Closes-bug: 1381218
This commit is contained in:
parent
a8752c1dee
commit
bc61411d5d
@ -9,19 +9,24 @@ Facter.add("osd_devices_list") do
|
||||
devs.each { |d|
|
||||
# lsblk returns cciss devices as cciss!c0d0p1. The entries
|
||||
# in /dev are cciss/c0d0p1
|
||||
d.gsub!(/!/, '/')
|
||||
parts = %x{ls /dev/#{d}?*}.gsub("/dev/#{d}","").split("\n")
|
||||
if d.gsub!(/!/, '/')
|
||||
sep = 'p'
|
||||
else
|
||||
sep = ''
|
||||
end
|
||||
device = "/dev/#{d}#{sep}"
|
||||
parts = %x{ls /dev/#{d}?*}.gsub(device,"").split("\n")
|
||||
parts.each { |p|
|
||||
code = %x{sgdisk -i #{p} /dev/#{d} | grep "Partition GUID code" | awk '{print $4}'}.strip()
|
||||
case code
|
||||
when "4FBD7E29-9D25-41B8-AFD0-062C0CEFF05D"
|
||||
# Only use unmounted devices
|
||||
if %x{grep -c /dev/#{d}#{p} /proc/mounts}.to_i == 0
|
||||
osds << "/dev/#{d}#{p}"
|
||||
if %x{grep -c #{device}#{p} /proc/mounts}.to_i == 0
|
||||
osds << "#{device}#{p}"
|
||||
end
|
||||
when "45B0969E-9B03-4F30-B4C6-B4B80CEFF106"
|
||||
if %x{grep -c /dev/#{d}#{p} /proc/mounts}.to_i == 0
|
||||
journals << "/dev/#{d}#{p}"
|
||||
if %x{grep -c #{device}#{p} /proc/mounts}.to_i == 0
|
||||
journals << "#{device}#{p}"
|
||||
end
|
||||
end
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user