facter 2.5.6-x86-mingw32 → 2.5.7-x86-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: 4bd8f8d56a472805a545f96d99125afd37d2b549b27503f1db28ef373570c5a0
4
- data.tar.gz: 9201dc506d452c71bf0a28836e8c30099e2175427c9e2cd39476f57433bf0cb5
3
+ metadata.gz: feb8c8d9feed609d8938a67783ad07f520251200aa87b87f4a2d242a0a96d21c
4
+ data.tar.gz: 78e7f350f3d0e03a58f72d752f7c405fa3c29c11942ee0bb939afe02a770d386
5
5
  SHA512:
6
- metadata.gz: 0ddf5ac375071996c6d629d6064d5f75f50dfe38942971c12fca12faea5a0c4b7460b55857dda70bbf25d99c8c0f33d44308bbf5c39a7a4ec30b1dcb329e9259
7
- data.tar.gz: dfae12222f23918f6184f08cb093c8fcfc133795a91773c74d67d2de24e94d8e818d8620b1142dbceaa5d5867ff36197ffce32b8c7ab2ec1b978039b1562e8a8
6
+ metadata.gz: b19081460e50d4a742aa56ccf7dce3dc6d6d800c1ceff6d716c99c4b69e4147cc5e093ded597afc08cd2505aebcb889df82939592559f7398ba283638433b009
7
+ data.tar.gz: 487424cfc01da49bc1ef6d35e86c869ca83b16d4c1f765c31a6777ee16ba0e3de498f4c7f2af6fa241f29809cd3e3ec5c7a392ebe6f7e2ee7f110a5c34fb252f
@@ -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: x86-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
@@ -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