Fixed #1850 - Facter updates for Ruby 1.9
James Turnbull
15 years ago
0 | 0 |
1.5.4:
|
|
1 |
Fixed #1850 - Facter updates for Ruby 1.9
|
|
2 |
|
1 | 3 |
Fixed #1926 - IPAddr to_s issue
|
2 | 4 |
|
3 | 5 |
Fixed Ubuntu operatingsystem identification
|
3 | 3 |
model = Facter.value(:hardwaremodel)
|
4 | 4 |
case model
|
5 | 5 |
# most linuxen use "x86_64"
|
6 | |
when 'x86_64':
|
|
6 |
when 'x86_64'
|
7 | 7 |
Facter.value(:operatingsystem) == "Debian" ? "amd64" : model;
|
8 | |
when /(i[3456]86|pentium)/: "i386"
|
|
8 |
when /(i[3456]86|pentium)/; "i386"
|
9 | 9 |
else
|
10 | 10 |
model
|
11 | 11 |
end
|
1 | 1 |
setcode do
|
2 | 2 |
require 'rbconfig'
|
3 | 3 |
case Config::CONFIG['host_os']
|
4 | |
when /mswin/i then 'windows'
|
|
4 |
when /mswin/i; 'windows'
|
5 | 5 |
else Facter::Util::Resolution.exec("uname -s")
|
6 | 6 |
end
|
7 | 7 |
end
|
13 | 13 |
# worst we'll have one. If we add more, this should be made more efficient.
|
14 | 14 |
options.each do |name, value|
|
15 | 15 |
case name
|
16 | |
when :ldapname: self.ldapname = value
|
|
16 |
when :ldapname; self.ldapname = value
|
17 | 17 |
else
|
18 | 18 |
raise ArgumentError, "Invalid fact option '%s'" % name
|
19 | 19 |
end
|
154 | 154 |
|
155 | 155 |
def self.element_type(item)
|
156 | 156 |
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'
|
160 | 160 |
else
|
161 | 161 |
raise "Don't know about this data type... something must be wrong!"
|
162 | 162 |
end
|