ohai 17.7.5 → 17.7.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/lib/ohai/mixin/network_helper.rb +10 -2
- data/lib/ohai/plugins/azure.rb +1 -1
- data/lib/ohai/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9624a58f805a1092cf71a19d5cc1501104c297df8b5f5cb9dafc8f288a77a62b
|
4
|
+
data.tar.gz: fa2839c8ca0d39f53629fc186b77addb1ef02e8783dba59a10f94d94406388ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
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)
|
data/lib/ohai/plugins/azure.rb
CHANGED
@@ -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?(
|
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
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.
|
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-
|
11
|
+
date: 2021-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef-config
|