ohai 16.6.5 → 16.7.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -7
  3. data/bin/ohai +1 -0
  4. data/lib/ohai.rb +1 -0
  5. data/lib/ohai/application.rb +1 -0
  6. data/lib/ohai/common/dmi.rb +1 -0
  7. data/lib/ohai/config.rb +1 -0
  8. data/lib/ohai/dsl.rb +1 -0
  9. data/lib/ohai/dsl/plugin.rb +1 -0
  10. data/lib/ohai/dsl/plugin/versionvii.rb +1 -0
  11. data/lib/ohai/exception.rb +1 -0
  12. data/lib/ohai/hints.rb +1 -0
  13. data/lib/ohai/log.rb +1 -0
  14. data/lib/ohai/mash.rb +1 -0
  15. data/lib/ohai/mixin/azure_metadata.rb +2 -1
  16. data/lib/ohai/mixin/chef_utils_wiring.rb +1 -0
  17. data/lib/ohai/mixin/command.rb +1 -0
  18. data/lib/ohai/mixin/constant_helper.rb +1 -0
  19. data/lib/ohai/mixin/dmi_decode.rb +1 -0
  20. data/lib/ohai/mixin/do_metadata.rb +3 -2
  21. data/lib/ohai/mixin/ec2_metadata.rb +2 -1
  22. data/lib/ohai/mixin/gce_metadata.rb +3 -2
  23. data/lib/ohai/mixin/http_helper.rb +1 -0
  24. data/lib/ohai/mixin/network_helper.rb +1 -0
  25. data/lib/ohai/mixin/os.rb +1 -0
  26. data/lib/ohai/mixin/scaleway_metadata.rb +3 -2
  27. data/lib/ohai/mixin/seconds_to_human.rb +1 -0
  28. data/lib/ohai/mixin/shell_out.rb +1 -0
  29. data/lib/ohai/mixin/softlayer_metadata.rb +2 -1
  30. data/lib/ohai/mixin/string.rb +1 -0
  31. data/lib/ohai/mixin/train_helpers.rb +1 -0
  32. data/lib/ohai/mixin/which.rb +1 -0
  33. data/lib/ohai/plugin_config.rb +1 -0
  34. data/lib/ohai/plugins/aix/kernel.rb +1 -0
  35. data/lib/ohai/plugins/aix/memory.rb +1 -0
  36. data/lib/ohai/plugins/aix/network.rb +2 -1
  37. data/lib/ohai/plugins/aix/platform.rb +1 -0
  38. data/lib/ohai/plugins/aix/uptime.rb +3 -2
  39. data/lib/ohai/plugins/azure.rb +1 -0
  40. data/lib/ohai/plugins/bsd/virtualization.rb +1 -0
  41. data/lib/ohai/plugins/c.rb +1 -0
  42. data/lib/ohai/plugins/chef.rb +1 -0
  43. data/lib/ohai/plugins/cloud.rb +1 -0
  44. data/lib/ohai/plugins/command.rb +1 -0
  45. data/lib/ohai/plugins/cpu.rb +2 -3
  46. data/lib/ohai/plugins/darwin/hardware.rb +1 -0
  47. data/lib/ohai/plugins/darwin/memory.rb +2 -3
  48. data/lib/ohai/plugins/darwin/network.rb +1 -0
  49. data/lib/ohai/plugins/darwin/platform.rb +1 -0
  50. data/lib/ohai/plugins/darwin/virtualization.rb +1 -0
  51. data/lib/ohai/plugins/digital_ocean.rb +1 -0
  52. data/lib/ohai/plugins/dmi.rb +1 -0
  53. data/lib/ohai/plugins/docker.rb +1 -0
  54. data/lib/ohai/plugins/dragonflybsd/memory.rb +1 -0
  55. data/lib/ohai/plugins/dragonflybsd/network.rb +1 -0
  56. data/lib/ohai/plugins/dragonflybsd/platform.rb +1 -0
  57. data/lib/ohai/plugins/ec2.rb +1 -0
  58. data/lib/ohai/plugins/elixir.rb +1 -1
  59. data/lib/ohai/plugins/erlang.rb +1 -0
  60. data/lib/ohai/plugins/eucalyptus.rb +4 -1
  61. data/lib/ohai/plugins/filesystem.rb +1 -1
  62. data/lib/ohai/plugins/fips.rb +1 -0
  63. data/lib/ohai/plugins/freebsd/memory.rb +1 -0
  64. data/lib/ohai/plugins/freebsd/network.rb +1 -0
  65. data/lib/ohai/plugins/freebsd/platform.rb +1 -0
  66. data/lib/ohai/plugins/gce.rb +1 -0
  67. data/lib/ohai/plugins/go.rb +1 -1
  68. data/lib/ohai/plugins/groovy.rb +1 -1
  69. data/lib/ohai/plugins/haskell.rb +1 -0
  70. data/lib/ohai/plugins/hostname.rb +1 -0
  71. data/lib/ohai/plugins/init_package.rb +1 -0
  72. data/lib/ohai/plugins/java.rb +1 -0
  73. data/lib/ohai/plugins/joyent.rb +1 -0
  74. data/lib/ohai/plugins/kernel.rb +2 -1
  75. data/lib/ohai/plugins/keys.rb +1 -0
  76. data/lib/ohai/plugins/languages.rb +1 -0
  77. data/lib/ohai/plugins/libvirt.rb +1 -0
  78. data/lib/ohai/plugins/linode.rb +1 -0
  79. data/lib/ohai/plugins/linux/block_device.rb +1 -0
  80. data/lib/ohai/plugins/linux/hostnamectl.rb +3 -2
  81. data/lib/ohai/plugins/linux/interrupts.rb +1 -0
  82. data/lib/ohai/plugins/linux/ipc.rb +1 -0
  83. data/lib/ohai/plugins/linux/lsb.rb +6 -19
  84. data/lib/ohai/plugins/linux/lspci.rb +1 -0
  85. data/lib/ohai/plugins/linux/machineid.rb +1 -0
  86. data/lib/ohai/plugins/linux/mdadm.rb +1 -0
  87. data/lib/ohai/plugins/linux/memory.rb +37 -36
  88. data/lib/ohai/plugins/linux/network.rb +1 -0
  89. data/lib/ohai/plugins/linux/platform.rb +2 -1
  90. data/lib/ohai/plugins/linux/selinux.rb +1 -0
  91. data/lib/ohai/plugins/linux/sessions.rb +1 -0
  92. data/lib/ohai/plugins/linux/sysctl.rb +1 -0
  93. data/lib/ohai/plugins/linux/systemd_paths.rb +1 -0
  94. data/lib/ohai/plugins/linux/virtualization.rb +1 -0
  95. data/lib/ohai/plugins/lua.rb +1 -1
  96. data/lib/ohai/plugins/mono.rb +1 -1
  97. data/lib/ohai/plugins/netbsd/memory.rb +1 -0
  98. data/lib/ohai/plugins/netbsd/network.rb +1 -0
  99. data/lib/ohai/plugins/netbsd/platform.rb +1 -0
  100. data/lib/ohai/plugins/network.rb +1 -0
  101. data/lib/ohai/plugins/nodejs.rb +1 -1
  102. data/lib/ohai/plugins/ohai.rb +1 -0
  103. data/lib/ohai/plugins/ohai_time.rb +1 -0
  104. data/lib/ohai/plugins/openbsd/memory.rb +1 -0
  105. data/lib/ohai/plugins/openbsd/network.rb +1 -0
  106. data/lib/ohai/plugins/openbsd/platform.rb +1 -0
  107. data/lib/ohai/plugins/openstack.rb +1 -0
  108. data/lib/ohai/plugins/os.rb +1 -0
  109. data/lib/ohai/plugins/packages.rb +1 -0
  110. data/lib/ohai/plugins/passwd.rb +1 -0
  111. data/lib/ohai/plugins/perl.rb +1 -1
  112. data/lib/ohai/plugins/php.rb +1 -1
  113. data/lib/ohai/plugins/platform.rb +1 -0
  114. data/lib/ohai/plugins/powershell.rb +1 -1
  115. data/lib/ohai/plugins/ps.rb +1 -0
  116. data/lib/ohai/plugins/python.rb +1 -1
  117. data/lib/ohai/plugins/rackspace.rb +2 -1
  118. data/lib/ohai/plugins/root_group.rb +1 -0
  119. data/lib/ohai/plugins/ruby.rb +3 -2
  120. data/lib/ohai/plugins/rust.rb +1 -1
  121. data/lib/ohai/plugins/scala.rb +1 -0
  122. data/lib/ohai/plugins/scaleway.rb +1 -0
  123. data/lib/ohai/plugins/scsi.rb +1 -0
  124. data/lib/ohai/plugins/shard.rb +1 -1
  125. data/lib/ohai/plugins/shells.rb +1 -0
  126. data/lib/ohai/plugins/softlayer.rb +1 -0
  127. data/lib/ohai/plugins/solaris2/dmi.rb +1 -0
  128. data/lib/ohai/plugins/solaris2/memory.rb +1 -0
  129. data/lib/ohai/plugins/solaris2/network.rb +1 -0
  130. data/lib/ohai/plugins/solaris2/platform.rb +6 -12
  131. data/lib/ohai/plugins/solaris2/virtualization.rb +2 -1
  132. data/lib/ohai/plugins/ssh_host_key.rb +1 -0
  133. data/lib/ohai/plugins/sysconf.rb +1 -0
  134. data/lib/ohai/plugins/timezone.rb +1 -0
  135. data/lib/ohai/plugins/train.rb +1 -0
  136. data/lib/ohai/plugins/uptime.rb +1 -0
  137. data/lib/ohai/plugins/virtualbox.rb +1 -0
  138. data/lib/ohai/plugins/vmware.rb +1 -0
  139. data/lib/ohai/plugins/windows/dmi.rb +1 -0
  140. data/lib/ohai/plugins/windows/drivers.rb +1 -0
  141. data/lib/ohai/plugins/windows/memory.rb +1 -0
  142. data/lib/ohai/plugins/windows/network.rb +2 -1
  143. data/lib/ohai/plugins/windows/platform.rb +1 -0
  144. data/lib/ohai/plugins/windows/system_enclosure.rb +1 -0
  145. data/lib/ohai/plugins/windows/virtualization.rb +1 -0
  146. data/lib/ohai/plugins/zpools.rb +5 -2
  147. data/lib/ohai/provides_map.rb +1 -0
  148. data/lib/ohai/runner.rb +3 -4
  149. data/lib/ohai/system.rb +1 -0
  150. data/lib/ohai/train_transport.rb +1 -0
  151. data/lib/ohai/util/file_helper.rb +1 -0
  152. data/lib/ohai/util/ip_helper.rb +1 -0
  153. data/lib/ohai/util/win32.rb +1 -0
  154. data/lib/ohai/version.rb +2 -1
  155. data/ohai.gemspec +1 -0
  156. metadata +2 -2
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Author:: Bryan McLellan (btm@loftninjas.org)
3
4
  # Copyright:: Copyright (c) 2009 Bryan McLellan
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Author:: Tim Dysinger (<tim@dysinger.net>)
3
4
  # Author:: Benjamin Black (<bb@chef.io>)
@@ -15,7 +15,7 @@
15
15
 
16
16
  Ohai.plugin(:Elixir) do
17
17
  provides "languages/elixir"
18
- depends "languages"
18
+ depends "languages".freeze
19
19
 
20
20
  collect_data do
21
21
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Author:: Joe Williams (<joe@joetify.com>)
3
4
  # Copyright:: Copyright (c) Chef Software Inc.
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Author:: Tim Dysinger (<tim@dysinger.net>)
3
4
  # Author:: Benjamin Black (<bb@chef.io>)
@@ -28,6 +29,8 @@ Ohai.plugin(:Eucalyptus) do
28
29
  provides "eucalyptus"
29
30
  depends "network/interfaces"
30
31
 
32
+ MAC_MATCH = /^[dD]0:0[dD]:/.freeze
33
+
31
34
  # returns the mac address from the collection of all address types
32
35
  def get_mac_address(addresses)
33
36
  detected_addresses = addresses.detect { |address, keypair| keypair == { "family" => "lladdr" } }
@@ -42,7 +45,7 @@ Ohai.plugin(:Eucalyptus) do
42
45
  def has_euca_mac?
43
46
  network[:interfaces].each_value do |iface|
44
47
  mac = get_mac_address(iface[:addresses])
45
- if /^[dD]0:0[dD]:/.match?(mac)
48
+ if MAC_MATCH.match?(mac)
46
49
  logger.trace("Plugin Eucalyptus: has_euca_mac? == true (#{mac})")
47
50
  return true
48
51
  end
@@ -24,7 +24,7 @@
24
24
  #
25
25
 
26
26
  Ohai.plugin(:Filesystem) do
27
- provides "filesystem"
27
+ provides "filesystem".freeze
28
28
 
29
29
  def find_device(name)
30
30
  %w{/dev /dev/mapper}.each do |dir|
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Author:: Matt Wrock (<matt@mattwrock.com>)
3
4
  # Copyright:: Copyright (c) Chef Software Inc.
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Author:: Bryan McLellan (btm@loftninjas.org)
3
4
  # Copyright:: Copyright (c) 2009 Bryan McLellan
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Author:: Bryan McLellan (btm@loftninjas.org)
3
4
  # Copyright:: Copyright (c) 2009 Bryan McLellan
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Author:: Bryan McLellan (btm@loftninjas.org)
3
4
  # Copyright:: Copyright (c) 2009 Bryan McLellan
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Author:: Ranjib Dey (<dey.ranjib@google.com>)
3
4
  # License:: Apache License, Version 2.0
@@ -15,7 +15,7 @@
15
15
 
16
16
  Ohai.plugin(:Go) do
17
17
  provides "languages/go"
18
- depends "languages"
18
+ depends "languages".freeze
19
19
 
20
20
  collect_data do
21
21
 
@@ -18,7 +18,7 @@
18
18
 
19
19
  Ohai.plugin(:Groovy) do
20
20
  provides "languages/groovy"
21
- depends "languages"
21
+ depends "languages".freeze
22
22
 
23
23
  collect_data do
24
24
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # Author:: Chris Dituri (<csdituri@gmail.com>)
2
3
  # Copyright:: Copyright (c) 2016 Chris Dituri
3
4
  # License:: Apache License, Version 2.0
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Author:: Adam Jacob (<adam@chef.io>)
3
4
  # Author:: Benjamin Black (<nostromo@gmail.com>)
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Author:: Caleb Tennis (<caleb.tennis@gmail.com>)
3
4
  # Copyright:: Copyright (c) Chef Software Inc.
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Author:: Benjamin Black (<bb@chef.io>)
3
4
  # Copyright:: Copyright (c) Chef Software Inc.
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Author: sawanoboriyu@higanworks.com
3
4
  # Copyright (C) 2014 HiganWorks LLC
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Author:: Adam Jacob (<adam@chef.io>)
3
4
  # Author:: Benjamin Black (<nostromo@gmail.com>)
@@ -244,7 +245,7 @@ Ohai.plugin(:Kernel) do
244
245
  # EXAMPLE:
245
246
  # Id Loadaddr Size Info Rev Module Name
246
247
  # 6 1180000 4623 1 1 specfs (filesystem for specfs)
247
- module_description = /[\s]*([\d]+)[\s]+([a-f\d]+)[\s]+([a-f\d]+)[\s]+(?:[\-\d]+)[\s]+(?:[\d]+)[\s]+([\S]+)[\s]+\((.+)\)$/
248
+ module_description = /\s*(\d+)\s+([a-f\d]+)\s+([a-f\d]+)\s+(?:[\-\d]+)\s+(?:\d+)\s+(\S+)\s+\((.+)\)$/
248
249
  so.stdout.lines do |line|
249
250
  if ( mod = module_description.match(line) )
250
251
  modules[mod[4]] = { id: mod[1].to_i, loadaddr: mod[2], size: mod[3].to_i(16), description: mod[5] }
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Cookbook Name:: apache2
3
4
  # Recipe:: default
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Author:: Adam Jacob (<adam@chef.io>)
3
4
  # Copyright:: Copyright (c) Chef Software Inc.
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Author:: Benjamin Black (<bb@chef.io>)
3
4
  # Copyright:: Copyright (c) Chef Software Inc.
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Author:: Aaron Kalin (<akalin@martinisoftware.com>)
3
4
  # License:: Apache License, Version 2.0
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Author:: Adam Jacob (<adam@chef.io>)
3
4
  # Copyright:: Copyright (c) Chef Software Inc.
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Author:: Davide Cavalca (<dcavalca@fb.com>)
3
4
  # Copyright:: Copyright (c) 2016 Facebook
@@ -25,8 +26,8 @@ Ohai.plugin(:Hostnamectl) do
25
26
  hostnamectl_path = which("hostnamectl")
26
27
  if hostnamectl_path
27
28
  shell_out(hostnamectl_path).stdout.split("\n").each do |line|
28
- key, val = line.split(":")
29
- hostnamectl[key.chomp.lstrip.tr(" ", "_").downcase] = val.chomp.lstrip
29
+ key, val = line.split(": ", 2)
30
+ hostnamectl[key.chomp.lstrip.tr(" ", "_").downcase] = val
30
31
  end
31
32
  end
32
33
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Author:: Davide Cavalca <dcavalca@fb.com>
3
4
  # Copyright:: Copyright (c) 2020 Facebook
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Author:: Jay Vana <jsvana@fb.com>
3
4
  # Author:: Davide Cavalca <dcavalca@fb.com>
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Author:: Adam Jacob (<adam@chef.io>)
3
4
  # Copyright:: Copyright (c) Chef Software Inc.
@@ -26,34 +27,20 @@ Ohai.plugin(:LSB) do
26
27
  # From package redhat-lsb on Fedora/Redhat, lsb-release on Debian/Ubuntu
27
28
  shell_out("lsb_release -a").stdout.lines do |line|
28
29
  case line
29
- when /^Distributor ID:\s+(.+)$/
30
+ when /^Distributor ID:\s+(.+)/
30
31
  lsb[:id] = $1
31
- when /^Description:\s+(.+)$/
32
+ when /^Description:\s+(.+)/
32
33
  lsb[:description] = $1
33
- when /^Release:\s+(.+)$/
34
+ when /^Release:\s+(.+)/
34
35
  lsb[:release] = $1
35
- when /^Codename:\s+(.+)$/
36
+ when /^Codename:\s+(.+)/
36
37
  lsb[:codename] = $1
37
38
  else
38
39
  lsb[:id] = line
39
40
  end
40
41
  end
41
- elsif file_exist?("/etc/lsb-release")
42
- # Old, non-standard Debian support
43
- file_open("/etc/lsb-release").each do |line|
44
- case line
45
- when /^DISTRIB_ID=["']?(.+?)["']?$/
46
- lsb[:id] = $1
47
- when /^DISTRIB_RELEASE=["']?(.+?)["']?$/
48
- lsb[:release] = $1
49
- when /^DISTRIB_CODENAME=["']?(.+?)["']?$/
50
- lsb[:codename] = $1
51
- when /^DISTRIB_DESCRIPTION=["']?(.+?)["']?$/
52
- lsb[:description] = $1
53
- end
54
- end
55
42
  else
56
- logger.trace("Plugin LSB: Skipping LSB, cannot find /etc/lsb-release or /usr/bin/lsb_release")
43
+ logger.trace("Plugin LSB: Skipping LSB, cannot find /usr/bin/lsb_release")
57
44
  end
58
45
  end
59
46
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Author:: Joerg Herzinger <joerg.herzinger@oiml.at>
3
4
  # Author:: Phil Dibowitz <phil@ipom.com>
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Author:: Davide Cavalca (<dcavalca@fb.com>)
3
4
  # Copyright:: Copyright (c) 2016 Facebook
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Author:: Tim Smith <tsmith@limelight.com>
3
4
  # Author:: Phil Dibowitz <phild@ipomc.com>
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Author:: Adam Jacob (<adam@chef.io>)
3
4
  # Copyright:: Copyright (c) Chef Software Inc.
@@ -27,77 +28,77 @@ Ohai.plugin(:Memory) do
27
28
 
28
29
  file_open("/proc/meminfo").each do |line|
29
30
  case line
30
- when /^MemTotal:\s+(\d+) (.+)$/
31
+ when /^MemTotal:\s+(\d+) (.+)/
31
32
  memory[:total] = "#{$1}#{$2}"
32
- when /^MemFree:\s+(\d+) (.+)$/
33
+ when /^MemFree:\s+(\d+) (.+)/
33
34
  memory[:free] = "#{$1}#{$2}"
34
- when /^MemAvailable:\s+(\d+) (.+)$/
35
+ when /^MemAvailable:\s+(\d+) (.+)/
35
36
  memory[:available] = "#{$1}#{$2}"
36
- when /^Buffers:\s+(\d+) (.+)$/
37
+ when /^Buffers:\s+(\d+) (.+)/
37
38
  memory[:buffers] = "#{$1}#{$2}"
38
- when /^Cached:\s+(\d+) (.+)$/
39
+ when /^Cached:\s+(\d+) (.+)/
39
40
  memory[:cached] = "#{$1}#{$2}"
40
- when /^Active:\s+(\d+) (.+)$/
41
+ when /^Active:\s+(\d+) (.+)/
41
42
  memory[:active] = "#{$1}#{$2}"
42
- when /^Inactive:\s+(\d+) (.+)$/
43
+ when /^Inactive:\s+(\d+) (.+)/
43
44
  memory[:inactive] = "#{$1}#{$2}"
44
- when /^HighTotal:\s+(\d+) (.+)$/
45
+ when /^HighTotal:\s+(\d+) (.+)/
45
46
  memory[:high_total] = "#{$1}#{$2}"
46
- when /^HighFree:\s+(\d+) (.+)$/
47
+ when /^HighFree:\s+(\d+) (.+)/
47
48
  memory[:high_free] = "#{$1}#{$2}"
48
- when /^LowTotal:\s+(\d+) (.+)$/
49
+ when /^LowTotal:\s+(\d+) (.+)/
49
50
  memory[:low_total] = "#{$1}#{$2}"
50
- when /^LowFree:\s+(\d+) (.+)$/
51
+ when /^LowFree:\s+(\d+) (.+)/
51
52
  memory[:low_free] = "#{$1}#{$2}"
52
- when /^Dirty:\s+(\d+) (.+)$/
53
+ when /^Dirty:\s+(\d+) (.+)/
53
54
  memory[:dirty] = "#{$1}#{$2}"
54
- when /^Writeback:\s+(\d+) (.+)$/
55
+ when /^Writeback:\s+(\d+) (.+)/
55
56
  memory[:writeback] = "#{$1}#{$2}"
56
- when /^AnonPages:\s+(\d+) (.+)$/
57
+ when /^AnonPages:\s+(\d+) (.+)/
57
58
  memory[:anon_pages] = "#{$1}#{$2}"
58
- when /^Mapped:\s+(\d+) (.+)$/
59
+ when /^Mapped:\s+(\d+) (.+)/
59
60
  memory[:mapped] = "#{$1}#{$2}"
60
- when /^Slab:\s+(\d+) (.+)$/
61
+ when /^Slab:\s+(\d+) (.+)/
61
62
  memory[:slab] = "#{$1}#{$2}"
62
- when /^SReclaimable:\s+(\d+) (.+)$/
63
+ when /^SReclaimable:\s+(\d+) (.+)/
63
64
  memory[:slab_reclaimable] = "#{$1}#{$2}"
64
- when /^SUnreclaim:\s+(\d+) (.+)$/
65
+ when /^SUnreclaim:\s+(\d+) (.+)/
65
66
  memory[:slab_unreclaim] = "#{$1}#{$2}"
66
- when /^PageTables:\s+(\d+) (.+)$/
67
+ when /^PageTables:\s+(\d+) (.+)/
67
68
  memory[:page_tables] = "#{$1}#{$2}"
68
- when /^NFS_Unstable:\s+(\d+) (.+)$/
69
+ when /^NFS_Unstable:\s+(\d+) (.+)/
69
70
  memory[:nfs_unstable] = "#{$1}#{$2}"
70
- when /^Bounce:\s+(\d+) (.+)$/
71
+ when /^Bounce:\s+(\d+) (.+)/
71
72
  memory[:bounce] = "#{$1}#{$2}"
72
- when /^CommitLimit:\s+(\d+) (.+)$/
73
+ when /^CommitLimit:\s+(\d+) (.+)/
73
74
  memory[:commit_limit] = "#{$1}#{$2}"
74
- when /^Committed_AS:\s+(\d+) (.+)$/
75
+ when /^Committed_AS:\s+(\d+) (.+)/
75
76
  memory[:committed_as] = "#{$1}#{$2}"
76
- when /^VmallocTotal:\s+(\d+) (.+)$/
77
+ when /^VmallocTotal:\s+(\d+) (.+)/
77
78
  memory[:vmalloc_total] = "#{$1}#{$2}"
78
- when /^VmallocUsed:\s+(\d+) (.+)$/
79
+ when /^VmallocUsed:\s+(\d+) (.+)/
79
80
  memory[:vmalloc_used] = "#{$1}#{$2}"
80
- when /^VmallocChunk:\s+(\d+) (.+)$/
81
+ when /^VmallocChunk:\s+(\d+) (.+)/
81
82
  memory[:vmalloc_chunk] = "#{$1}#{$2}"
82
- when /^SwapCached:\s+(\d+) (.+)$/
83
+ when /^SwapCached:\s+(\d+) (.+)/
83
84
  memory[:swap][:cached] = "#{$1}#{$2}"
84
- when /^SwapTotal:\s+(\d+) (.+)$/
85
+ when /^SwapTotal:\s+(\d+) (.+)/
85
86
  memory[:swap][:total] = "#{$1}#{$2}"
86
- when /^SwapFree:\s+(\d+) (.+)$/
87
+ when /^SwapFree:\s+(\d+) (.+)/
87
88
  memory[:swap][:free] = "#{$1}#{$2}"
88
- when /^HugePages_Total:\s+(\d+)$/
89
+ when /^HugePages_Total:\s+(\d+)/
89
90
  memory[:hugepages][:total] = $1.to_s
90
- when /^HugePages_Free:\s+(\d+)$/
91
+ when /^HugePages_Free:\s+(\d+)/
91
92
  memory[:hugepages][:free] = $1.to_s
92
- when /^HugePages_Rsvd:\s+(\d+)$/
93
+ when /^HugePages_Rsvd:\s+(\d+)/
93
94
  memory[:hugepages][:reserved] = $1.to_s
94
- when /^HugePages_Surp:\s+(\d+)$/
95
+ when /^HugePages_Surp:\s+(\d+)/
95
96
  memory[:hugepages][:surplus] = $1.to_s
96
- when /^Hugepagesize:\s+(\d+) (.+)$/
97
+ when /^Hugepagesize:\s+(\d+) (.+)/
97
98
  memory[:hugepage_size] = "#{$1}#{$2}"
98
- when /^Hugetlb:\s+(\d+) (.+)$/
99
+ when /^Hugetlb:\s+(\d+) (.+)/
99
100
  memory[:hugetlb] = "#{$1}#{$2}"
100
- when /^DirectMap([0-9]+[a-zA-Z]):\s+(\d+) (.+)$/
101
+ when /^DirectMap([0-9]+[a-zA-Z]):\s+(\d+) (.+)/
101
102
  memory[:directmap][$1.to_sym] = "#{$2}#{$3}"
102
103
  end
103
104
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Author:: Adam Jacob (<adam@chef.io>)
3
4
  # Author:: Chris Read <chris.read@gmail.com>
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Author:: Adam Jacob (<adam@chef.io>)
3
4
  # Copyright:: Copyright (c) Chef Software Inc.
@@ -132,7 +133,7 @@ Ohai.plugin(:Platform) do
132
133
  #
133
134
  def platform_family_from_platform(plat)
134
135
  case plat
135
- when /debian/, /ubuntu/, /linuxmint/, /raspbian/, /cumulus/, /kali/
136
+ when /debian/, /ubuntu/, /linuxmint/, /raspbian/, /cumulus/, /kali/, /pop/
136
137
  # apt-get+dpkg almost certainly goes here
137
138
  "debian"
138
139
  when /oracle/, /centos/, /redhat/, /scientific/, /enterpriseenterprise/, /xcp/, /xenserver/, /cloudlinux/, /ibm_powerkvm/, /parallels/, /nexus_centos/, /clearos/, /bigip/ # Note that 'enterpriseenterprise' is oracle's LSB "distributor ID"
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Author:: Davide Cavalca <dcavalca@fb.com>
3
4
  # Copyright:: Copyright (c) 2020 Facebook
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Author:: Davide Cavalca <dcavalca@fb.com>
3
4
  # Copyright:: Copyright (c) 2016 Facebook
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Author:: Joshua Miller <joshmiller@fb.com>
3
4
  # Copyright:: Copyright (c) 2019 Facebook
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Author:: Davide Cavalca <dcavalca@fb.com>
3
4
  # Copyright:: Copyright (c) 2017 Facebook
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # Author:: Thom May (<thom@clearairturbulence.org>)
3
4
  # Copyright:: Copyright (c) Chef Software Inc.
@@ -18,7 +18,7 @@
18
18
 
19
19
  Ohai.plugin(:Lua) do
20
20
  provides "languages/lua"
21
- depends "languages"
21
+ depends "languages".freeze
22
22
 
23
23
  collect_data do
24
24