facter 1.7.4 → 1.7.5.rc1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of facter might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 200bd702df6f9e080be48569faf28a0671a514e8
4
- data.tar.gz: abb9fca5559a5efb859c167a79ad24cb53607030
3
+ metadata.gz: a3fc8d44493b3305d2a7cd17a5575a26e22e07b7
4
+ data.tar.gz: b25972153d23ae4ee4fa8f148e3f812aee624eb4
5
5
  SHA512:
6
- metadata.gz: 6f81dc36a6d94c1ab05836576a92b9f9e3bbc9cd7869be07410ef23af63b7d54381cbd42aee7e9ef3c57ecf79453836856cc348a58c2ea923513f48890f33477
7
- data.tar.gz: e5a1a133adeb650e5a8d060110833055a1eca074e988bc85ca503b05c9dbcd9d59c17738f14b0c88ecba0c0eaea6cb98504f28fa5d043d11be68e645689694dc
6
+ metadata.gz: b1af1b9c237a35e5c5095a73ea6c5c31c39f18b06946120578cfefdedad9d598943788a5c23e5b87a01ac53b9e8113fa88d42b11f71cc92c0f6cd9eb71c294a5
7
+ data.tar.gz: 69096694148f153e9228de797c2740c32e45a24ffcb3abdd7dd0e33721334125b64982aca790020f0827a52f95cc1a2c93b2d4170112a50c6762c2426d23b801
data/Gemfile CHANGED
@@ -9,7 +9,7 @@ platforms :ruby do
9
9
  gem 'watchr', :group => :development
10
10
  gem 'pry', :group => :development
11
11
  gem 'yard', :group => :development
12
- gem 'redcarpet', :group => :development
12
+ gem 'redcarpet', '<= 2.3.0', :group => :development
13
13
  end
14
14
 
15
15
  group :development, :test do
@@ -1,6 +1,6 @@
1
1
  directories:
2
2
  lib:
3
- path: 'usr/lib/ruby/site_ruby/1.8'
3
+ path: 'Library/Ruby/Site'
4
4
  owner: 'root'
5
5
  group: 'wheel'
6
6
  perms: '0644'
@@ -8,23 +8,26 @@
8
8
  # ${3} is the destination volume so that this works correctly
9
9
  # when being installed to volumes other than the current OS.
10
10
 
11
- <% begin %>
12
- <% require 'rubygems' %>
13
- <% rescue LoadError %>
14
- <% end %>
15
- <% require 'rake' %>
11
+ <%- ["@apple_libdir", "@apple_sbindir", "@apple_bindir", "@apple_docdir", "@package_name"].each do |i| -%>
12
+ <%- val = instance_variable_get(i) -%>
13
+ <%- raise "Critical variable #{i} is unset!" if val.nil? or val.empty? -%>
14
+ <%- end -%>
15
+
16
+ # remove ruby library files
17
+ <%- Dir.chdir("lib") do -%>
18
+ <%- [@apple_old_libdir, @apple_libdir].compact.each do |libdir| -%>
19
+ <%- Dir.glob("*").each do |file| -%>
20
+ /bin/rm -Rf "${3}<%= libdir %>/<%= file %>"
21
+ <%- end -%>
22
+ <%- end -%>
23
+ <%- end -%>
16
24
 
17
- # remove libdir
18
- <% Dir.chdir("lib") %>
19
- <% FileList["**/*"].select {|i| File.file?(i)}.each do |file| %>
20
- /bin/rm -Rf "${3}<%= @apple_libdir %>/<%=file%>"
21
- <% end %>
22
25
  # remove bin files
23
- <% Dir.chdir("../bin") %>
24
- <% FileList["**/*"].select {|i| File.file?(i)}.each do |file| %>
25
- /bin/rm -Rf "${3}<%= @apple_bindir %>/<%=file%>"
26
- <% end %>
27
- <% Dir.chdir("..") %>
26
+ <%- Dir.chdir("bin") do -%>
27
+ <%- Dir.glob("*").each do |file| -%>
28
+ /bin/rm -Rf "${3}<%= @apple_bindir %>/<%= file %>"
29
+ <%- end -%>
30
+ <%- end -%>
28
31
 
29
32
  # remove old doc files
30
- /bin/rm -Rf "${3}<%= @apple_docdir %>/<%=@package_name%>"
33
+ /bin/rm -Rf "${3}<%= @apple_docdir %>/<%= @package_name %>"
@@ -164,7 +164,12 @@ module Facter::Util::CFPropertyList
164
164
  when Object.const_defined?('BigDecimal') && object.is_a?(BigDecimal)
165
165
  CFReal.new(object)
166
166
  when object.respond_to?(:read)
167
- CFData.new(object.read(), CFData::DATA_RAW)
167
+ raw_data = object.read
168
+ # treat the data as a bytestring (ASCII-8BIT) if Ruby supports it. Do this by forcing
169
+ # the encoding, on the assumption that the bytes were read correctly, and just tagged with
170
+ # an inappropriate encoding, rather than transcoding.
171
+ raw_data.force_encoding(Encoding::ASCII_8BIT) if raw_data.respond_to?(:force_encoding)
172
+ CFData.new(raw_data, CFData::DATA_RAW)
168
173
  when options[:converter_method] && object.respond_to?(options[:converter_method])
169
174
  if options[:converter_with_opts]
170
175
  Facter::Util::CFPropertyList.guess(object.send(options[:converter_method],options),options)
@@ -1,6 +1,6 @@
1
1
  module Facter
2
2
  if not defined? FACTERVERSION then
3
- FACTERVERSION = '1.7.4'
3
+ FACTERVERSION = '1.7.5-rc1'
4
4
  end
5
5
 
6
6
  ##
@@ -133,7 +133,7 @@ Facter.add("virtual") do
133
133
  end
134
134
 
135
135
  # Parse dmidecode
136
- output = Facter::Util::Resolution.exec('dmidecode')
136
+ output = Facter::Util::Resolution.exec('dmidecode 2> /dev/null')
137
137
  if output
138
138
  lines = output.split("\n")
139
139
  next "parallels" if lines.any? {|l| l =~ /Parallels/ }
@@ -91,7 +91,7 @@ describe Facter::Util::Virtual do
91
91
 
92
92
  it "should identify kvm" do
93
93
  Facter::Util::Virtual.stubs(:kvm?).returns(true)
94
- Facter::Util::Resolution.stubs(:exec).with('dmidecode').returns("something")
94
+ Facter::Util::Resolution.stubs(:exec).with('dmidecode 2> /dev/null').returns("something")
95
95
  Facter::Util::Virtual.kvm_type().should == "kvm"
96
96
  end
97
97
 
@@ -108,7 +108,7 @@ describe "Virtual fact" do
108
108
 
109
109
  it "should be vmware with VMWare vendor name from dmidecode" do
110
110
  Facter::Util::Resolution.stubs(:exec).with('lspci 2>/dev/null').returns(nil)
111
- Facter::Util::Resolution.stubs(:exec).with('dmidecode').returns("On Board Device 1 Information\nType: Video\nStatus: Disabled\nDescription: VMware SVGA II")
111
+ Facter::Util::Resolution.stubs(:exec).with('dmidecode 2> /dev/null').returns("On Board Device 1 Information\nType: Video\nStatus: Disabled\nDescription: VMware SVGA II")
112
112
  Facter.fact(:virtual).value.should == "vmware"
113
113
  end
114
114
 
@@ -134,33 +134,33 @@ describe "Virtual fact" do
134
134
 
135
135
  it "should be xenhvm with Xen HVM vendor name from dmidecode" do
136
136
  Facter::Util::Resolution.stubs(:exec).with('lspci 2>/dev/null').returns(nil)
137
- Facter::Util::Resolution.stubs(:exec).with('dmidecode').returns("System Information\nManufacturer: Xen\nProduct Name: HVM domU")
137
+ Facter::Util::Resolution.stubs(:exec).with('dmidecode 2> /dev/null').returns("System Information\nManufacturer: Xen\nProduct Name: HVM domU")
138
138
  Facter.fact(:virtual).value.should == "xenhvm"
139
139
  end
140
140
 
141
141
  it "should be parallels with Parallels vendor name from dmidecode" do
142
142
  Facter::Util::Resolution.stubs(:exec).with('lspci 2>/dev/null').returns(nil)
143
- Facter::Util::Resolution.stubs(:exec).with('dmidecode').returns("On Board Device Information\nType: Video\nStatus: Disabled\nDescription: Parallels Video Adapter")
143
+ Facter::Util::Resolution.stubs(:exec).with('dmidecode 2> /dev/null').returns("On Board Device Information\nType: Video\nStatus: Disabled\nDescription: Parallels Video Adapter")
144
144
  Facter.fact(:virtual).value.should == "parallels"
145
145
  end
146
146
 
147
147
  it "should be virtualbox with VirtualBox vendor name from dmidecode" do
148
148
  Facter::Util::Resolution.stubs(:exec).with('lspci 2>/dev/null').returns(nil)
149
- Facter::Util::Resolution.stubs(:exec).with('dmidecode').returns("BIOS Information\nVendor: innotek GmbH\nVersion: VirtualBox\n\nSystem Information\nManufacturer: innotek GmbH\nProduct Name: VirtualBox\nFamily: Virtual Machine")
149
+ Facter::Util::Resolution.stubs(:exec).with('dmidecode 2> /dev/null').returns("BIOS Information\nVendor: innotek GmbH\nVersion: VirtualBox\n\nSystem Information\nManufacturer: innotek GmbH\nProduct Name: VirtualBox\nFamily: Virtual Machine")
150
150
  Facter.fact(:virtual).value.should == "virtualbox"
151
151
  end
152
152
 
153
153
  it "should be rhev with RHEV Hypervisor product name from dmidecode" do
154
154
  Facter.fact(:kernel).stubs(:value).returns("Linux")
155
155
  Facter::Util::Resolution.stubs(:exec).with('lspci 2>/dev/null').returns(nil)
156
- Facter::Util::Resolution.stubs(:exec).with('dmidecode').returns("Product Name: RHEV Hypervisor")
156
+ Facter::Util::Resolution.stubs(:exec).with('dmidecode 2> /dev/null').returns("Product Name: RHEV Hypervisor")
157
157
  Facter.fact(:virtual).value.should == "rhev"
158
158
  end
159
159
 
160
160
  it "should be ovirt with oVirt Node product name from dmidecode" do
161
161
  Facter.fact(:kernel).stubs(:value).returns("Linux")
162
162
  Facter::Util::Resolution.stubs(:exec).with('lspci 2>/dev/null').returns(nil)
163
- Facter::Util::Resolution.stubs(:exec).with('dmidecode').returns("Product Name: oVirt Node")
163
+ Facter::Util::Resolution.stubs(:exec).with('dmidecode 2> /dev/null').returns("Product Name: oVirt Node")
164
164
  Facter.fact(:virtual).value.should == "ovirt"
165
165
  end
166
166
 
@@ -171,7 +171,7 @@ describe "Virtual fact" do
171
171
 
172
172
  it "should be hyperv with Microsoft vendor name from dmidecode" do
173
173
  Facter::Util::Resolution.stubs(:exec).with('lspci 2>/dev/null').returns(nil)
174
- Facter::Util::Resolution.stubs(:exec).with('dmidecode').returns("System Information\nManufacturer: Microsoft Corporation\nProduct Name: Virtual Machine")
174
+ Facter::Util::Resolution.stubs(:exec).with('dmidecode 2> /dev/null').returns("System Information\nManufacturer: Microsoft Corporation\nProduct Name: Virtual Machine")
175
175
  Facter.fact(:virtual).value.should == "hyperv"
176
176
  end
177
177
 
@@ -208,7 +208,7 @@ describe "Virtual fact" do
208
208
 
209
209
  it "(#20236) is vmware when dmidecode contains vmware and lspci returns insufficient information" do
210
210
  Facter::Util::Resolution.stubs(:exec).with('lspci 2>/dev/null').returns("garbage\ninformation\n")
211
- Facter::Util::Resolution.stubs(:exec).with('dmidecode').returns("On Board Device 1 Information\nType: Video\nStatus: Disabled\nDescription: VMware SVGA II")
211
+ Facter::Util::Resolution.stubs(:exec).with('dmidecode 2> /dev/null').returns("On Board Device 1 Information\nType: Video\nStatus: Disabled\nDescription: VMware SVGA II")
212
212
  Facter.fact(:virtual).value.should eq("vmware")
213
213
  end
214
214
  end
@@ -222,7 +222,7 @@ describe "Virtual fact" do
222
222
  it "should be vmware with VMWare vendor name from prtdiag" do
223
223
  Facter.fact(:hardwaremodel).stubs(:value).returns(nil)
224
224
  Facter::Util::Resolution.stubs(:exec).with('lspci 2>/dev/null').returns(nil)
225
- Facter::Util::Resolution.stubs(:exec).with('dmidecode').returns(nil)
225
+ Facter::Util::Resolution.stubs(:exec).with('dmidecode 2> /dev/null').returns(nil)
226
226
  Facter::Util::Resolution.stubs(:exec).with('prtdiag').returns("System Configuration: VMware, Inc. VMware Virtual Platform")
227
227
  Facter.fact(:virtual).value.should == "vmware"
228
228
  end
@@ -230,7 +230,7 @@ describe "Virtual fact" do
230
230
  it "should be parallels with Parallels vendor name from prtdiag" do
231
231
  Facter.fact(:hardwaremodel).stubs(:value).returns(nil)
232
232
  Facter::Util::Resolution.stubs(:exec).with('lspci 2>/dev/null').returns(nil)
233
- Facter::Util::Resolution.stubs(:exec).with('dmidecode').returns(nil)
233
+ Facter::Util::Resolution.stubs(:exec).with('dmidecode 2> /dev/null').returns(nil)
234
234
  Facter::Util::Resolution.stubs(:exec).with('prtdiag').returns("System Configuration: Parallels Virtual Platform")
235
235
  Facter.fact(:virtual).value.should == "parallels"
236
236
  end
@@ -238,7 +238,7 @@ describe "Virtual fact" do
238
238
  it "should be virtualbox with VirtualBox vendor name from prtdiag" do
239
239
  Facter.fact(:hardwaremodel).stubs(:value).returns(nil)
240
240
  Facter::Util::Resolution.stubs(:exec).with('lspci 2>/dev/null').returns(nil)
241
- Facter::Util::Resolution.stubs(:exec).with('dmidecode').returns(nil)
241
+ Facter::Util::Resolution.stubs(:exec).with('dmidecode 2> /dev/null').returns(nil)
242
242
  Facter::Util::Resolution.stubs(:exec).with('prtdiag').returns("System Configuration: innotek GmbH VirtualBox")
243
243
  Facter.fact(:virtual).value.should == "virtualbox"
244
244
  end
@@ -250,7 +250,7 @@ describe "Virtual fact" do
250
250
  Facter.fact(:kernel).stubs(:value).returns("OpenBSD")
251
251
  Facter.fact(:hardwaremodel).stubs(:value).returns(nil)
252
252
  Facter::Util::Resolution.stubs(:exec).with('lspci 2>/dev/null').returns(nil)
253
- Facter::Util::Resolution.stubs(:exec).with('dmidecode').returns(nil)
253
+ Facter::Util::Resolution.stubs(:exec).with('dmidecode 2> /dev/null').returns(nil)
254
254
  end
255
255
 
256
256
  it "should be parallels with Parallels product name from sysctl" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: facter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.4
4
+ version: 1.7.5.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet Labs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-17 00:00:00.000000000 Z
11
+ date: 2014-01-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: You can prove anything with facts!
14
14
  email: info@puppetlabs.com
@@ -398,9 +398,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
398
398
  version: '0'
399
399
  required_rubygems_version: !ruby/object:Gem::Requirement
400
400
  requirements:
401
- - - '>='
401
+ - - '>'
402
402
  - !ruby/object:Gem::Version
403
- version: '0'
403
+ version: 1.3.1
404
404
  requirements: []
405
405
  rubyforge_project:
406
406
  rubygems_version: 2.0.3