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|
|
devs.each { |d|
|
||||||
# lsblk returns cciss devices as cciss!c0d0p1. The entries
|
# lsblk returns cciss devices as cciss!c0d0p1. The entries
|
||||||
# in /dev are cciss/c0d0p1
|
# in /dev are cciss/c0d0p1
|
||||||
d.gsub!(/!/, '/')
|
if d.gsub!(/!/, '/')
|
||||||
parts = %x{ls /dev/#{d}?*}.gsub("/dev/#{d}","").split("\n")
|
sep = 'p'
|
||||||
|
else
|
||||||
|
sep = ''
|
||||||
|
end
|
||||||
|
device = "/dev/#{d}#{sep}"
|
||||||
|
parts = %x{ls /dev/#{d}?*}.gsub(device,"").split("\n")
|
||||||
parts.each { |p|
|
parts.each { |p|
|
||||||
code = %x{sgdisk -i #{p} /dev/#{d} | grep "Partition GUID code" | awk '{print $4}'}.strip()
|
code = %x{sgdisk -i #{p} /dev/#{d} | grep "Partition GUID code" | awk '{print $4}'}.strip()
|
||||||
case code
|
case code
|
||||||
when "4FBD7E29-9D25-41B8-AFD0-062C0CEFF05D"
|
when "4FBD7E29-9D25-41B8-AFD0-062C0CEFF05D"
|
||||||
# Only use unmounted devices
|
# Only use unmounted devices
|
||||||
if %x{grep -c /dev/#{d}#{p} /proc/mounts}.to_i == 0
|
if %x{grep -c #{device}#{p} /proc/mounts}.to_i == 0
|
||||||
osds << "/dev/#{d}#{p}"
|
osds << "#{device}#{p}"
|
||||||
end
|
end
|
||||||
when "45B0969E-9B03-4F30-B4C6-B4B80CEFF106"
|
when "45B0969E-9B03-4F30-B4C6-B4B80CEFF106"
|
||||||
if %x{grep -c /dev/#{d}#{p} /proc/mounts}.to_i == 0
|
if %x{grep -c #{device}#{p} /proc/mounts}.to_i == 0
|
||||||
journals << "/dev/#{d}#{p}"
|
journals << "#{device}#{p}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
@ -41,4 +46,4 @@ Facter.add("osd_devices_list") do
|
|||||||
end
|
end
|
||||||
output.join(" ")
|
output.join(" ")
|
||||||
end
|
end
|
||||||
end
|
end
|
Loading…
Reference in New Issue
Block a user