facter 2.5.6-x64-mingw32 → 2.5.7-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ee5af31b5e7e6ada250e8eed46963abd4dd62799ad4bc195b0f79285c110761e
4
- data.tar.gz: baa68280e3d7bea87b5596dbafef244cc45a4ba8661055575b0e168adffdb437
3
+ metadata.gz: d9710f106ab645bb921879197031fbce80288b5fbc172eec9d92d75b095f246a
4
+ data.tar.gz: 78e7f350f3d0e03a58f72d752f7c405fa3c29c11942ee0bb939afe02a770d386
5
5
  SHA512:
6
- metadata.gz: a2dc304eb877b5a15361eb2fd040aff2050018c6ab3d92d5cae4df88362ced4d792d28008544bd4d2534e840b4a6d7521dba2d92eacfc73f5e39552b0f463e73
7
- data.tar.gz: 5bcefe42f8e21be095d6503667d56e1fb413a2b910481b48027db5bcc7f00512c7232790f23d6c1f0961348c755e81e8306a2094f7299cd60c6e326779016a71
6
+ metadata.gz: f3307ae8cc63d09b750c2f45b6b0fabc108a78a2a1fb8ab7a8e03b40a36057d701ab5600e482c0354b701da721d052b325e2f421c2b5f6d8b9c81f97c5b43d42
7
+ data.tar.gz: 487424cfc01da49bc1ef6d35e86c869ca83b16d4c1f765c31a6777ee16ba0e3de498f4c7f2af6fa241f29809cd3e3ec5c7a392ebe6f7e2ee7f110a5c34fb252f
data/lib/facter/ec2.rb CHANGED
@@ -20,7 +20,7 @@ require 'facter/ec2/rest' unless defined?(Facter::EC2)
20
20
  Facter.define_fact(:ec2_metadata) do
21
21
  define_resolution(:rest) do
22
22
  confine do
23
- Facter.value(:virtual).match /^(xen|kvm)/
23
+ Facter.value(:virtual).match /^(xen|kvm|nitro|ec2)/
24
24
  end
25
25
 
26
26
  @querier = Facter::EC2::Metadata.new
@@ -37,7 +37,7 @@ end
37
37
  Facter.define_fact(:ec2_userdata) do
38
38
  define_resolution(:rest) do
39
39
  confine do
40
- Facter.value(:virtual).match /^(xen|kvm)/
40
+ Facter.value(:virtual).match /^(xen|kvm|nitro|ec2)/
41
41
  end
42
42
 
43
43
  @querier = Facter::EC2::Userdata.new
@@ -17,7 +17,7 @@ module Facter
17
17
  Timeout::Error,
18
18
  ]
19
19
 
20
- METADATA_URL = "http://metadata/computeMetadata/v1beta1/?recursive=true&alt=json"
20
+ METADATA_URL = "http://metadata/computeMetadata/v1/?recursive=true&alt=json"
21
21
 
22
22
  def initialize(url = METADATA_URL)
23
23
  @url = url
@@ -45,7 +45,7 @@ module Facter
45
45
 
46
46
  begin
47
47
  Timeout.timeout(timeout) do
48
- body = open(@url, :proxy => nil).read
48
+ body = open(@url, options={:proxy => nil, "Metadata-Flavor" => "Google"}).read
49
49
  end
50
50
  rescue *CONNECTION_ERRORS => e
51
51
  attempts = attempts + 1
@@ -163,7 +163,7 @@ module Facter::Util::IP
163
163
  ifconfig_output = Facter::Util::IP.ifconfig_interface(interface)
164
164
  if interface =~ /^ib/ then
165
165
  real_mac_address = get_infiniband_macaddress(interface)
166
- output = ifconfig_output.sub(%r{(?:ether|HWaddr)\s+((\w{1,2}:){5,}\w{1,2})}, "HWaddr #{real_mac_address}")
166
+ output = ifconfig_output.sub(%r{(?:ether|HWaddr|infiniband)\s+((\w{1,2}:){5,}\w{1,2})}, "HWaddr #{real_mac_address}")
167
167
  else
168
168
  output = ifconfig_output
169
169
  end
@@ -106,6 +106,10 @@ module Facter::Util::Virtual
106
106
  end
107
107
  end
108
108
 
109
+ def self.ec2?
110
+ File.read("/sys/devices/virtual/dmi/id/bios_vendor") =~ /Amazon EC2/ rescue false
111
+ end
112
+
109
113
  def self.kvm?
110
114
  txt = if FileTest.exists?("/proc/cpuinfo")
111
115
  File.read("/proc/cpuinfo")
@@ -142,6 +146,10 @@ module Facter::Util::Virtual
142
146
  File.read("/sys/devices/virtual/dmi/id/product_name") =~ /Google/ rescue false
143
147
  end
144
148
 
149
+ def self.nitro?
150
+ File.read("/sys/devices/virtual/dmi/id/bios_vendor") =~ /Amazon/ rescue false
151
+ end
152
+
145
153
  def self.jail?
146
154
  path = case Facter.value(:kernel)
147
155
  when "FreeBSD" then "/sbin"
@@ -1,6 +1,6 @@
1
1
  module Facter
2
2
  if not defined? FACTERVERSION then
3
- FACTERVERSION = '2.5.6'
3
+ FACTERVERSION = '2.5.7'
4
4
  end
5
5
 
6
6
  # Returns the running version of Facter.
@@ -145,10 +145,15 @@ Facter.add("virtual") do
145
145
  next "xenu" if FileTest.exists?("/proc/xen") || FileTest.exists?("/dev/xvda1")
146
146
  end
147
147
 
148
+ if Facter::Util::Virtual.ec2?
149
+ next "ec2" if FileTest.exists?("/dev/nvme0")
150
+ end
151
+
148
152
  next "virtualbox" if Facter::Util::Virtual.virtualbox?
149
153
  next Facter::Util::Virtual.kvm_type if Facter::Util::Virtual.kvm?
150
154
  next "rhev" if Facter::Util::Virtual.rhev?
151
155
  next "ovirt" if Facter::Util::Virtual.ovirt?
156
+ next "nitro" if Facter::Util::Virtual.nitro?
152
157
 
153
158
  # Parse lspci
154
159
  output = Facter::Util::Virtual.lspci
@@ -225,6 +230,10 @@ Facter.add("virtual") do
225
230
  result = "xen"
226
231
  end
227
232
 
233
+ if result.nil? and computersystem.manufacturer =~ /Amazon/
234
+ result = "nitro"
235
+ end
236
+
228
237
  break
229
238
  end
230
239
  result ||= "physical"
@@ -0,0 +1,8 @@
1
+ ib0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 2044
2
+ inet 10.55.200.50 netmask 255.255.0.0 broadcast 10.55.255.255
3
+ Infiniband hardware address can be incorrect! Please read BUGS section in ifconfig(8).
4
+ HWaddr 80:00:00:03:fe:80:00:00:00:00:00:00:00:11:75:00:00:6f:02:fe txqueuelen 256 (InfiniBand)
5
+ RX packets 26603237 bytes 15921365732 (14.8 GiB)
6
+ RX errors 0 dropped 0 overruns 0 frame 0
7
+ TX packets 22735277 bytes 4196650455 (3.9 GiB)
8
+ TX errors 0 dropped 2 overruns 0 carrier 0 collisions 0
@@ -0,0 +1,8 @@
1
+ ib0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 2044
2
+ inet 10.55.200.50 netmask 255.255.0.0 broadcast 10.55.255.255
3
+ Infiniband hardware address can be incorrect! Please read BUGS section in ifconfig(8).
4
+ infiniband 80:00:00:03:FE:80:00:00:00:00:00:00:00:00:00:00:00:00:00:00 txqueuelen 256 (InfiniBand)
5
+ RX packets 26603237 bytes 15921365732 (14.8 GiB)
6
+ RX errors 0 dropped 0 overruns 0 frame 0
7
+ TX packets 22735277 bytes 4196650455 (3.9 GiB)
8
+ TX errors 0 dropped 2 overruns 0 carrier 0 collisions 0
@@ -176,6 +176,26 @@ describe Facter::Util::IP do
176
176
  Facter::Util::IP.get_single_interface_output("ib0").should == correct_ifconfig_interface
177
177
  end
178
178
 
179
+ it "should return correct macaddress information for infiniband on Linux CentOS 7" do
180
+ correct_ifconfig_interface = my_fixture_read("linux_get_single_interface_ib0_centos7")
181
+
182
+ Facter::Util::IP.expects(:get_single_interface_output).with("ib0").returns(correct_ifconfig_interface)
183
+ Facter.stubs(:value).with(:kernel).returns("Linux")
184
+
185
+ Facter::Util::IP.get_interface_value("ib0", "macaddress").should == "80:00:00:03:fe:80:00:00:00:00:00:00:00:11:75:00:00:6f:02:fe"
186
+ end
187
+
188
+ it "should replace the incorrect macaddress with the correct macaddress in ifconfig for infiniband on Linux CentOS 7" do
189
+ ifconfig_interface = my_fixture_read("linux_ifconfig_ib0_centos7")
190
+ correct_ifconfig_interface = my_fixture_read("linux_get_single_interface_ib0_centos7")
191
+
192
+ Facter::Util::IP.expects(:get_infiniband_macaddress).with("ib0").returns("80:00:00:03:fe:80:00:00:00:00:00:00:00:11:75:00:00:6f:02:fe")
193
+ Facter::Util::IP.expects(:ifconfig_interface).with("ib0").returns(ifconfig_interface)
194
+ Facter.stubs(:value).with(:kernel).returns("Linux")
195
+
196
+ Facter::Util::IP.get_single_interface_output("ib0").should == correct_ifconfig_interface
197
+ end
198
+
179
199
  it "should return fake macaddress information for infiniband on Linux when neither sysfs or /sbin/ip are available" do
180
200
  ifconfig_interface = my_fixture_read("linux_ifconfig_ib0")
181
201
 
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: 2.5.6
4
+ version: 2.5.7
5
5
  platform: x64-mingw32
6
6
  authors:
7
7
  - Puppet Labs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-26 00:00:00.000000000 Z
11
+ date: 2020-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -34,7 +34,6 @@ files:
34
34
  - COMMITTERS.md
35
35
  - CONTRIBUTING.md
36
36
  - Gemfile
37
- - Gemfile.lock
38
37
  - LICENSE
39
38
  - README.md
40
39
  - Rakefile
@@ -350,9 +349,11 @@ files:
350
349
  - spec/fixtures/unit/util/ip/linux_2_6_35_proc_net_bonding_bond0
351
350
  - spec/fixtures/unit/util/ip/linux_get_single_interface_eth0
352
351
  - spec/fixtures/unit/util/ip/linux_get_single_interface_ib0
352
+ - spec/fixtures/unit/util/ip/linux_get_single_interface_ib0_centos7
353
353
  - spec/fixtures/unit/util/ip/linux_get_single_interface_lo
354
354
  - spec/fixtures/unit/util/ip/linux_ifconfig_all_with_single_interface
355
355
  - spec/fixtures/unit/util/ip/linux_ifconfig_ib0
356
+ - spec/fixtures/unit/util/ip/linux_ifconfig_ib0_centos7
356
357
  - spec/fixtures/unit/util/ip/solaris_ifconfig_all_with_multiple_interfaces
357
358
  - spec/fixtures/unit/util/ip/solaris_ifconfig_single_interface
358
359
  - spec/fixtures/unit/util/ip/windows_netsh_all_interfaces
@@ -546,7 +547,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
546
547
  - !ruby/object:Gem::Version
547
548
  version: '0'
548
549
  requirements: []
549
- rubygems_version: 3.0.4
550
+ rubygems_version: 3.1.2
550
551
  signing_key:
551
552
  specification_version: 4
552
553
  summary: Facter, a system inventory tool
@@ -699,9 +700,11 @@ test_files:
699
700
  - spec/fixtures/unit/util/ip/linux_2_6_35_proc_net_bonding_bond0
700
701
  - spec/fixtures/unit/util/ip/linux_get_single_interface_eth0
701
702
  - spec/fixtures/unit/util/ip/linux_get_single_interface_ib0
703
+ - spec/fixtures/unit/util/ip/linux_get_single_interface_ib0_centos7
702
704
  - spec/fixtures/unit/util/ip/linux_get_single_interface_lo
703
705
  - spec/fixtures/unit/util/ip/linux_ifconfig_all_with_single_interface
704
706
  - spec/fixtures/unit/util/ip/linux_ifconfig_ib0
707
+ - spec/fixtures/unit/util/ip/linux_ifconfig_ib0_centos7
705
708
  - spec/fixtures/unit/util/ip/solaris_ifconfig_all_with_multiple_interfaces
706
709
  - spec/fixtures/unit/util/ip/solaris_ifconfig_single_interface
707
710
  - spec/fixtures/unit/util/ip/windows_netsh_all_interfaces
data/Gemfile.lock DELETED
@@ -1,79 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- facter (2.5.4)
5
- redcarpet (<= 2.3.0)
6
- watchr
7
- yard
8
-
9
- GEM
10
- remote: https://artifactory.delivery.puppetlabs.net/artifactory/api/gems/rubygems/
11
- specs:
12
- CFPropertyList (2.3.6)
13
- addressable (2.3.8)
14
- artifactory (3.0.0)
15
- builder (3.2.3)
16
- coderay (1.1.2)
17
- diff-lcs (1.1.3)
18
- json (1.8.6)
19
- json-schema (2.6.2)
20
- addressable (~> 2.3.8)
21
- metaclass (0.0.4)
22
- method_source (0.9.2)
23
- mocha (0.10.5)
24
- metaclass (~> 0.0.1)
25
- packaging (0.99.0)
26
- artifactory
27
- rake
28
- pry (0.12.2)
29
- coderay (~> 1.1.0)
30
- method_source (~> 0.9.0)
31
- puppet-lint (2.3.6)
32
- puppet-syntax (2.5.0)
33
- rake
34
- puppetlabs_spec_helper (1.1.1)
35
- mocha
36
- puppet-lint
37
- puppet-syntax
38
- rake
39
- rspec-puppet
40
- rake (10.1.1)
41
- redcarpet (2.3.0)
42
- rspec (2.11.0)
43
- rspec-core (~> 2.11.0)
44
- rspec-expectations (~> 2.11.0)
45
- rspec-mocks (~> 2.11.0)
46
- rspec-core (2.11.1)
47
- rspec-expectations (2.11.3)
48
- diff-lcs (~> 1.1.3)
49
- rspec-mocks (2.11.3)
50
- rspec-puppet (2.7.5)
51
- rspec
52
- watchr (0.7)
53
- yard (0.9.20)
54
- yarjuf (1.0.5)
55
- builder
56
- rspec (>= 2.0)
57
-
58
- PLATFORMS
59
- ruby
60
-
61
- DEPENDENCIES
62
- CFPropertyList (~> 2.2)
63
- facter (>= 1.0.0)!
64
- ffi (~> 1.9.18)
65
- json (~> 1.7)
66
- json-schema (~> 2.6.2)
67
- mocha (~> 0.10.5)
68
- packaging (~> 0.99)
69
- pry
70
- puppetlabs_spec_helper
71
- rake (~> 10.1.0)
72
- redcarpet (<= 2.3.0)
73
- rspec (~> 2.11.0)
74
- watchr
75
- yard
76
- yarjuf (~> 1.0)
77
-
78
- BUNDLED WITH
79
- 1.17.1