ohai 17.7.5 → 17.7.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 19b09efb3e8a7318b9401b9faf1fb17a472544ec5c7f45e7be090bcaafac9d93
4
- data.tar.gz: d6deeb673906082bda7ab8ac7b4b1b5fb8dc41c22720ab4f4d47dfa994479be6
3
+ metadata.gz: 9624a58f805a1092cf71a19d5cc1501104c297df8b5f5cb9dafc8f288a77a62b
4
+ data.tar.gz: fa2839c8ca0d39f53629fc186b77addb1ef02e8783dba59a10f94d94406388ce
5
5
  SHA512:
6
- metadata.gz: a8aec83f05fb402a2cc08efa9ce6d6fc81a0c2133bc57f60c9cbedff90236812e30e65373b5bb4813590ea2c7d5ae6c763caa58bbf56ef10c4ac5362df1dbc59
7
- data.tar.gz: 948e93dddd2a283f43350795e15b46d83fe31db12d9f988bbe594882295fb7c57e576bc18be0a4db1d22002a177a6dddcce49f041dbc24cd777c75b59e62bce4
6
+ metadata.gz: 4252161549ecd67b7bfd91c7b01673071b54d76179472ac2824965281147a5b40b14b2cc120fc8d2d1a41bc1956041c1c39bf820f3d538f2ee85b61771d11c66
7
+ data.tar.gz: 3f1be719448a8c6cb39be6b5cb2f1c9017e05abd223d3b2bc23aedb4891a8663e259f6a3f2828a8a7e5809f52dde821fcefaeeb534af80cc4729ba19bcc63514
data/Gemfile CHANGED
@@ -9,7 +9,7 @@ gem "chef-utils", git: "https://github.com/chef/chef", branch: "main", glob: "ch
9
9
 
10
10
  # NOTE: do not submit PRs to add pry as a dep, add to your Gemfile.local
11
11
  group :development do
12
- gem "chefstyle", "2.1.0"
12
+ gem "chefstyle", "2.1.2"
13
13
  gem "ipaddr_extensions"
14
14
  gem "rake", ">= 10.1.0"
15
15
  gem "rspec-collection_matchers", "~> 1.0"
@@ -18,6 +18,8 @@
18
18
  # limitations under the License.
19
19
  #
20
20
 
21
+ require "socket" unless defined?(Socket)
22
+
21
23
  module Ohai
22
24
  module Mixin
23
25
  module NetworkHelper
@@ -34,10 +36,16 @@ module Ohai
34
36
  end
35
37
 
36
38
  # This does a forward and reverse lookup on the hostname to return what should be
37
- # the FQDN for the host determined by name lookup (generally DNS)
39
+ # the FQDN for the host determined by name lookup (generally DNS). If the forward
40
+ # lookup fails this will throw. If the reverse lookup fails this will return the
41
+ # hostname back. The behavior on failure of the reverse lookup is both vitally important
42
+ # to this API, and completely untested, so changes to this method (not recommended) need
43
+ # to be manually validated by hand by setting up a DNS server with a broken A record to
44
+ # an IP without a PTR record (e.g. any RFC1918 space not served by the configured DNS
45
+ # server), and the method should return the hostname and not the IP address.
38
46
  #
39
47
  def canonicalize_hostname(hostname)
40
- Addrinfo.getaddrinfo(hostname, nil).first.getnameinfo.first
48
+ Addrinfo.getaddrinfo(hostname, nil, nil, nil, nil, Socket::AI_CANONNAME).first.canonname
41
49
  end
42
50
 
43
51
  def canonicalize_hostname_with_retries(hostname)
@@ -48,7 +48,7 @@ Ohai.plugin(:Azure) do
48
48
  # check for either the waagent or the unknown-245 DHCP option that Azure uses
49
49
  # http://blog.mszcool.com/index.php/2015/04/detecting-if-a-virtual-machine-runs-in-microsoft-azure-linux-windows-to-protect-your-software-when-distributed-via-the-azure-marketplace/
50
50
  def has_waagent?
51
- if file_exist?("/usr/sbin/waagent") || dir_exist?('C:\WindowsAzure')
51
+ if file_exist?("/usr/sbin/waagent") || dir_exist?("C:\\WindowsAzure")
52
52
  logger.trace("Plugin Azure: Found waagent used by Azure.")
53
53
  true
54
54
  end
data/lib/ohai/version.rb CHANGED
@@ -19,5 +19,5 @@
19
19
 
20
20
  module Ohai
21
21
  OHAI_ROOT = File.expand_path(__dir__)
22
- VERSION = "17.7.5"
22
+ VERSION = "17.7.8"
23
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ohai
3
3
  version: !ruby/object:Gem::Version
4
- version: 17.7.5
4
+ version: 17.7.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Jacob
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-21 00:00:00.000000000 Z
11
+ date: 2021-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef-config