ohai 16.7.37 → 16.8.1

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: 39d6064d1c93ab4dac377f1883213fad35872ee08ac0c2b97801b5d96da1a1df
4
- data.tar.gz: 5837422d08995fd7057e84d496d85b11514bd51b6b0d391b282fb3612fb083bc
3
+ metadata.gz: 168be10defab5e91f8da06ce4d101a461ed13a2051d4b6901c3039571c7a3066
4
+ data.tar.gz: 8783ddbdc49208974d09cfc7e708760402248719baaf2a1a8dce28e8a14902bc
5
5
  SHA512:
6
- metadata.gz: d58037d84d3f6066b86561940dffe8b812d89ef6e75a7a0a8a843affccb7b6fc98e29795d2bd62ce48b396eefc71901423e198274d5474c95e1fb189101f4992
7
- data.tar.gz: cc8c6cbd38084685fe8cb8dccdc3f5c469829b0798c562fb8803dc37d0c3aacf2a844781689ef0f3a5796929f43951d59b083531fea4ed08a46a07395bb8a06d
6
+ metadata.gz: 5781908ba60b11f68397c10693d6c084e1eb021dc5a6b1348448b712225322295cc5b510dc41e9feecbf1a463d23f47773428ce540c138b43a2c6fd9ced079a4
7
+ data.tar.gz: 50a9ba71dca6681a84536c1f443653dc4d78172ded2fffa9022ad8ed8e577a0dc3e1bc6329b021438fe3ee6d2d62d1154093928fb3fb53957df38363f0bf92c2
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+ #
3
+ # Author:: Davide Cavalca <dcavalca@fb.com>
4
+ # Copyright:: Copyright (c) 2020 Facebook
5
+ # License:: Apache License, Version 2.0
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ #
19
+
20
+ Ohai.plugin(:Grub2) do
21
+ provides "grub2/environment"
22
+ optional true
23
+
24
+ collect_data(:dragonflybsd, :freebsd, :linux, :netbsd) do
25
+ editenv_path = which("grub2-editenv")
26
+ if editenv_path
27
+ editenv_out = shell_out("#{editenv_path} list")
28
+
29
+ grub2 Mash.new unless grub2
30
+ grub2[:environment] ||= Mash.new
31
+
32
+ editenv_out.stdout.each_line do |line|
33
+ key, val = line.split("=", 2)
34
+ grub2[:environment][key] = val.strip
35
+ end
36
+ else
37
+ logger.trace("Plugin Grub2: Could not find grub2-editenv. Skipping plugin.")
38
+ end
39
+ end
40
+ end
@@ -18,31 +18,38 @@
18
18
  Ohai.plugin(:Linode) do
19
19
  provides "linode"
20
20
 
21
- depends "kernel"
21
+ depends "domain"
22
22
  depends "network/interfaces"
23
23
 
24
- # Checks for matching linode kernel name
24
+ # Checks to see if the node is in the members.linode.com domain
25
25
  #
26
- # Returns true or false
27
- def has_linode_kernel?
28
- if ( kernel_data = kernel )
29
- kernel_data[:release].split("-").last.include?("linode")
30
- end
26
+ # @return [Boolean]
27
+ #
28
+ def has_linode_domain?
29
+ domain&.include?("linode")
30
+ end
31
+
32
+ # Checks for linode mirrors in the apt sources.list file
33
+ #
34
+ # @return [Boolean]
35
+ #
36
+ def has_linode_apt_repos?
37
+ file_exist?("/etc/apt/sources.list") && file_read("/etc/apt/sources.list").include?("linode")
31
38
  end
32
39
 
33
40
  # Identifies the linode cloud by preferring the hint, then
34
41
  #
35
- # Returns true or false
42
+ # @return [Boolean]
43
+ #
36
44
  def looks_like_linode?
37
- hint?("linode") || has_linode_kernel?
45
+ hint?("linode") || has_linode_domain? || has_linode_apt_repos?
38
46
  end
39
47
 
40
- # Names linode ip address
48
+ # Alters linode mash with new interface based on name parameter
41
49
  #
42
- # name - symbol of ohai name (e.g. :public_ip)
43
- # eth - Interface name (e.g. :eth0)
50
+ # @param [Symbol] name Ohai name (e.g. :public_ip)
51
+ # @param [Symbol] eth Interface name (e.g. :eth0)
44
52
  #
45
- # Alters linode mash with new interface based on name parameter
46
53
  def get_ip_address(name, eth)
47
54
  if ( eth_iface = network[:interfaces][eth] )
48
55
  eth_iface[:addresses].each do |key, info|
@@ -19,7 +19,6 @@
19
19
  # limitations under the License.
20
20
 
21
21
  Ohai.plugin(:Lspci) do
22
- depends "platform"
23
22
  provides "pci"
24
23
  optional true
25
24
 
@@ -18,7 +18,6 @@
18
18
  #
19
19
 
20
20
  Ohai.plugin(:Lsscsi) do
21
- depends "platform"
22
21
  provides "scsi"
23
22
  optional true
24
23
 
@@ -19,5 +19,5 @@
19
19
 
20
20
  module Ohai
21
21
  OHAI_ROOT = File.expand_path(__dir__)
22
- VERSION = "16.7.37"
22
+ VERSION = "16.8.1"
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: 16.7.37
4
+ version: 16.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Jacob
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-24 00:00:00.000000000 Z
11
+ date: 2020-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef-config
@@ -285,6 +285,7 @@ files:
285
285
  - lib/ohai/plugins/gce.rb
286
286
  - lib/ohai/plugins/go.rb
287
287
  - lib/ohai/plugins/groovy.rb
288
+ - lib/ohai/plugins/grub2.rb
288
289
  - lib/ohai/plugins/haskell.rb
289
290
  - lib/ohai/plugins/hostname.rb
290
291
  - lib/ohai/plugins/init_package.rb