blob: 0940707a1d8a3f37d37029a0559729532c86ff82 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
Facter.add('blkid') do
setcode do
lines = Facter::Core::Execution.execute('blkid').split("\n")
out = {}
lines.each do |line|
a = line.match(/^([^:]*):(.*)/)
d = {}
remaining = a[2]
while m = remaining.match(/ (\w*)="([^"]*)"/) do
d[m[1]] = m[2]
remaining = m.post_match
end
out[a[1]] = d
end
out
end
end
|