23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
# File 'lib/rubyipmi/freeipmi/commands/bmcinfo.rb', line 23
def retrieve
bmcinfo = {}
status = runcmd
subkey = nil
if not status
raise @result
else
@result.lines.each do |line|
item = line.split(':')
key = item.first.strip
value = item.last.strip
if key == value and not subkey
subkey = key
bmcinfo[subkey] = []
elsif key == value and subkey
bmcinfo[subkey] << value.gsub(/\[|\]/, "")
else
subkey = nil
bmcinfo[key] = value
end
end
return bmcinfo
end
end
|