Codebase list facter / 063e4dc
Fixed #1850 - Facter updates for Ruby 1.9 James Turnbull 15 years ago
6 changed file(s) with 13 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
00 1.5.4:
1 Fixed #1850 - Facter updates for Ruby 1.9
2
13 Fixed #1926 - IPAddr to_s issue
24
35 Fixed Ubuntu operatingsystem identification
33 model = Facter.value(:hardwaremodel)
44 case model
55 # most linuxen use "x86_64"
6 when 'x86_64':
6 when 'x86_64'
77 Facter.value(:operatingsystem) == "Debian" ? "amd64" : model;
8 when /(i[3456]86|pentium)/: "i386"
8 when /(i[3456]86|pentium)/; "i386"
99 else
1010 model
1111 end
11 setcode do
22 require 'rbconfig'
33 case Config::CONFIG['host_os']
4 when /mswin/i then 'windows'
4 when /mswin/i; 'windows'
55 else Facter::Util::Resolution.exec("uname -s")
66 end
77 end
1313 # worst we'll have one. If we add more, this should be made more efficient.
1414 options.each do |name, value|
1515 case name
16 when :ldapname: self.ldapname = value
16 when :ldapname; self.ldapname = value
1717 else
1818 raise ArgumentError, "Invalid fact option '%s'" % name
1919 end
154154
155155 def self.element_type(item)
156156 return case item
157 when String, Symbol: 'string'
158 when Fixnum, Bignum, Integer: 'integer'
159 when Float: 'real'
157 when String, Symbol; 'string'
158 when Fixnum, Bignum, Integer; 'integer'
159 when Float; 'real'
160160 else
161161 raise "Don't know about this data type... something must be wrong!"
162162 end
150150 def self.debugging(bit)
151151 if bit
152152 case bit
153 when TrueClass: @@debug = 1
154 when FalseClass: @@debug = 0
155 when Fixnum:
153 when TrueClass; @@debug = 1
154 when FalseClass; @@debug = 0
155 when Fixnum
156156 if bit > 0
157157 @@debug = 1
158158 else
159159 @@debug = 0
160160 end
161 when String:
161 when String;
162162 if bit.downcase == 'off'
163163 @@debug = 0
164164 else