lib/facter/util/manufacturer.rb in facter-1.6.2 vs lib/facter/util/manufacturer.rb in facter-1.6.3

- old
+ new

@@ -61,14 +61,13 @@ end end def self.prtdiag_sparc_find_system_info() # Parses prtdiag for a SPARC architecture string, won't work with Solaris x86 - output = Facter::Util::Resolution.exec('/usr/sbin/prtdiag') + output = Facter::Util::Resolution.exec('/usr/sbin/prtdiag 2>/dev/null') # System Configuration: Sun Microsystems sun4u Sun SPARC Enterprise M3000 Server - sysconfig = output.split("\n")[0] - if sysconfig =~ /^System Configuration:\s+(.+?)\s+(sun\d+\S+)\s+(.+)/ then + if output and output =~ /^System Configuration:\s+(.+?)\s+(sun\d+\S+)\s+(.+)/ Facter.add('manufacturer') do setcode do $1 end end