We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f3a1811 commit eafb0e2Copy full SHA for eafb0e2
hanlon_microkernel/facter/hnl_mk_sys.rb
@@ -17,7 +17,13 @@
17
lines = definition.split(/\n/)
18
19
# Create a hash of attributes for each section (i.e. cpu)
20
- attribs = Hash[ lines.collect { |l| l =~ /^\s*([^:]+):\s+(.*)\s*$/; v=$2; [$1.gsub(/\s/, '_'), v] } ]
+ attribs = Hash[ lines.collect do |l|
21
+ begin
22
+ l =~ /^\s*([^:]+):\s+(.*)\s*$/; v=$2; [$1.gsub(/\s/, '_'), v]
23
+ rescue NoMethodError
24
+ puts "Error: (system class) unable to parse %{l}"
25
+ end
26
+ end ]
27
attribs.each_pair do |attrib, val|
28
Facter.add("mk_hw_sys_#{attrib}") do
29
setcode { val }
0 commit comments