ohai 16.4.12 → 16.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/lib/ohai.rb +1 -1
  4. data/lib/ohai/config.rb +1 -1
  5. data/lib/ohai/dsl.rb +1 -1
  6. data/lib/ohai/dsl/plugin.rb +5 -5
  7. data/lib/ohai/dsl/plugin/versionvii.rb +1 -1
  8. data/lib/ohai/exception.rb +1 -1
  9. data/lib/ohai/hints.rb +1 -1
  10. data/lib/ohai/loader.rb +1 -1
  11. data/lib/ohai/log.rb +1 -1
  12. data/lib/ohai/mixin/azure_metadata.rb +1 -1
  13. data/lib/ohai/mixin/chef_utils_wiring.rb +39 -0
  14. data/lib/ohai/mixin/command.rb +3 -54
  15. data/lib/ohai/mixin/constant_helper.rb +1 -1
  16. data/lib/ohai/mixin/dmi_decode.rb +1 -1
  17. data/lib/ohai/mixin/do_metadata.rb +1 -1
  18. data/lib/ohai/mixin/ec2_metadata.rb +1 -1
  19. data/lib/ohai/mixin/http_helper.rb +1 -1
  20. data/lib/ohai/mixin/network_helper.rb +1 -1
  21. data/lib/ohai/mixin/os.rb +1 -1
  22. data/lib/ohai/mixin/scaleway_metadata.rb +1 -1
  23. data/lib/ohai/mixin/seconds_to_human.rb +1 -1
  24. data/lib/ohai/mixin/shell_out.rb +50 -0
  25. data/lib/ohai/mixin/string.rb +1 -1
  26. data/lib/ohai/mixin/which.rb +38 -0
  27. data/lib/ohai/plugin_config.rb +1 -1
  28. data/lib/ohai/plugins/aix/kernel.rb +1 -1
  29. data/lib/ohai/plugins/aix/memory.rb +3 -3
  30. data/lib/ohai/plugins/aix/network.rb +1 -1
  31. data/lib/ohai/plugins/aix/platform.rb +1 -1
  32. data/lib/ohai/plugins/aix/uptime.rb +1 -1
  33. data/lib/ohai/plugins/aix/virtualization.rb +1 -1
  34. data/lib/ohai/plugins/azure.rb +1 -1
  35. data/lib/ohai/plugins/bsd/virtualization.rb +2 -2
  36. data/lib/ohai/plugins/cloud.rb +1 -1
  37. data/lib/ohai/plugins/command.rb +1 -1
  38. data/lib/ohai/plugins/cpu.rb +2 -2
  39. data/lib/ohai/plugins/darwin/memory.rb +1 -1
  40. data/lib/ohai/plugins/darwin/network.rb +1 -1
  41. data/lib/ohai/plugins/darwin/platform.rb +2 -2
  42. data/lib/ohai/plugins/darwin/virtualization.rb +1 -1
  43. data/lib/ohai/plugins/docker.rb +1 -1
  44. data/lib/ohai/plugins/ec2.rb +2 -2
  45. data/lib/ohai/plugins/erlang.rb +1 -1
  46. data/lib/ohai/plugins/eucalyptus.rb +1 -1
  47. data/lib/ohai/plugins/filesystem.rb +1 -1
  48. data/lib/ohai/plugins/fips.rb +1 -1
  49. data/lib/ohai/plugins/hostname.rb +1 -1
  50. data/lib/ohai/plugins/init_package.rb +1 -1
  51. data/lib/ohai/plugins/java.rb +1 -1
  52. data/lib/ohai/plugins/kernel.rb +2 -2
  53. data/lib/ohai/plugins/keys.rb +1 -1
  54. data/lib/ohai/plugins/languages.rb +1 -1
  55. data/lib/ohai/plugins/libvirt.rb +1 -1
  56. data/lib/ohai/plugins/linode.rb +1 -1
  57. data/lib/ohai/plugins/linux/block_device.rb +1 -1
  58. data/lib/ohai/plugins/linux/lsb.rb +1 -1
  59. data/lib/ohai/plugins/linux/memory.rb +1 -1
  60. data/lib/ohai/plugins/linux/network.rb +9 -9
  61. data/lib/ohai/plugins/linux/platform.rb +1 -1
  62. data/lib/ohai/plugins/linux/virtualization.rb +1 -1
  63. data/lib/ohai/plugins/network.rb +1 -1
  64. data/lib/ohai/plugins/ohai_time.rb +1 -1
  65. data/lib/ohai/plugins/openstack.rb +1 -1
  66. data/lib/ohai/plugins/os.rb +1 -1
  67. data/lib/ohai/plugins/packages.rb +20 -0
  68. data/lib/ohai/plugins/perl.rb +1 -1
  69. data/lib/ohai/plugins/platform.rb +1 -1
  70. data/lib/ohai/plugins/powershell.rb +1 -1
  71. data/lib/ohai/plugins/ps.rb +1 -1
  72. data/lib/ohai/plugins/python.rb +1 -1
  73. data/lib/ohai/plugins/shard.rb +1 -1
  74. data/lib/ohai/plugins/shells.rb +1 -1
  75. data/lib/ohai/plugins/softlayer.rb +1 -1
  76. data/lib/ohai/plugins/solaris2/network.rb +6 -8
  77. data/lib/ohai/plugins/solaris2/platform.rb +1 -1
  78. data/lib/ohai/plugins/solaris2/virtualization.rb +1 -1
  79. data/lib/ohai/plugins/ssh_host_key.rb +1 -1
  80. data/lib/ohai/plugins/uptime.rb +1 -1
  81. data/lib/ohai/plugins/virtualbox.rb +1 -1
  82. data/lib/ohai/plugins/vmware.rb +1 -1
  83. data/lib/ohai/plugins/windows/drivers.rb +1 -1
  84. data/lib/ohai/plugins/windows/network.rb +1 -1
  85. data/lib/ohai/plugins/windows/platform.rb +1 -1
  86. data/lib/ohai/plugins/windows/system_enclosure.rb +1 -1
  87. data/lib/ohai/plugins/windows/virtualization.rb +1 -1
  88. data/lib/ohai/plugins/zpools.rb +1 -1
  89. data/lib/ohai/provides_map.rb +1 -1
  90. data/lib/ohai/runner.rb +1 -1
  91. data/lib/ohai/system.rb +2 -3
  92. data/lib/ohai/util/file_helper.rb +4 -37
  93. data/lib/ohai/util/win32.rb +1 -1
  94. data/lib/ohai/version.rb +2 -2
  95. metadata +5 -2
@@ -2,7 +2,7 @@
2
2
  # Author:: Kaustubh Deorukhkar (<kaustubh@clogeny.com>)
3
3
  # Author:: Prabhu Das (<prabhu.das@clogeny.com>)
4
4
  # Author:: Isa Farnik (<isa@chef.io>)
5
- # Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
5
+ # Copyright:: Copyright (c) Chef Software Inc.
6
6
  # License:: Apache License, Version 2.0
7
7
  #
8
8
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # Author:: Joshua Timberman <joshua@chef.io>
3
3
  # Author:: Isa Farnik (<isa@chef.io>)
4
- # Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
4
+ # Copyright:: Copyright (c) Chef Software Inc.
5
5
  # License:: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # Author:: Kurt Yoder (<ktyopscode@yoderhome.com>)
3
3
  # Author:: Isa Farnik (<isa@chef.io>)
4
- # Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
4
+ # Copyright:: Copyright (c) Chef Software Inc.
5
5
  # License:: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # Author:: Julian C. Dunn (<jdunn@chef.io>)
3
3
  # Author:: Isa Farnik (<isa@chef.io>)
4
- # Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
4
+ # Copyright:: Copyright (c) Chef Software Inc.
5
5
  # License:: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2013-2017 Chef Software, Inc.
1
+ # Copyright:: Copyright (c) Chef Software Inc.
2
2
  # License:: Apache License, Version 2.0
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # Author:: Bryan McLellan (btm@loftninjas.org)
3
3
  # Copyright:: Copyright (c) 2009 Bryan McLellan
4
- # Copyright:: Copyright (c) 2015-2018 Chef Software, Inc.
4
+ # Copyright:: Copyright (c) Chef Software Inc.
5
5
  # License:: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -49,7 +49,7 @@ Ohai.plugin(:Virtualization) do
49
49
  end
50
50
 
51
51
  # detect from modules
52
- so = shell_out((Ohai.abs_path("/sbin/kldstat")).to_s)
52
+ so = shell_out(Ohai.abs_path("/sbin/kldstat").to_s)
53
53
  so.stdout.lines do |line|
54
54
  case line
55
55
  when /vboxdrv/
@@ -100,7 +100,7 @@ Ohai.plugin(:Cloud) do
100
100
  @cloud[:local_ipv6] = @cloud[:local_ipv6_addrs][0] if @cloud[:local_ipv6_addrs]
101
101
 
102
102
  # if empty, return nil
103
- (@cloud.empty?) ? nil : @cloud
103
+ @cloud.empty? ? nil : @cloud
104
104
  end
105
105
 
106
106
  private
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Adam Jacob (<adam@chef.io>)
3
- # Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
3
+ # Copyright:: Copyright (c) Chef Software Inc.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -8,7 +8,7 @@
8
8
  # Author:: Prabhu Das (<prabhu.das@clogeny.com>)
9
9
  # Author:: Isa Farnik (<isa@chef.io>)
10
10
  # Author:: Doug MacEachern <dougm@vmware.com>
11
- # Copyright:: Copyright (c) 2008-2018 Chef Software, Inc.
11
+ # Copyright:: Copyright (c) Chef Software Inc.
12
12
  # License:: Apache License, Version 2.0
13
13
  #
14
14
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -61,7 +61,7 @@ Ohai.plugin(:CPU) do
61
61
  cpu_number += 1
62
62
  when /vendor_id\s+:\s(.+)/
63
63
  vendor_id = $1
64
- if vendor_id =~ (%r{IBM/S390})
64
+ if vendor_id.include?("IBM/S390")
65
65
  cpuinfo["vendor_id"] = vendor_id
66
66
  else
67
67
  cpuinfo[current_cpu]["vendor_id"] = vendor_id
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Patrick Collins (<pat@burned.com>)
3
- # Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
3
+ # Copyright:: Copyright (c) Chef Software Inc.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Benjamin Black (<bb@chef.io>)
3
- # Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
3
+ # Copyright:: Copyright (c) Chef Software Inc.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Adam Jacob (<adam@chef.io>)
3
- # Copyright:: Copyright (c) Chef Software, Inc.
3
+ # Copyright:: Copyright (c) Chef Software Inc.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -20,7 +20,7 @@ Ohai.plugin(:Platform) do
20
20
  provides "platform", "platform_version", "platform_build", "platform_family"
21
21
 
22
22
  collect_data(:darwin) do
23
- so = shell_out((Ohai.abs_path( "/usr/bin/sw_vers" )).to_s)
23
+ so = shell_out(Ohai.abs_path( "/usr/bin/sw_vers" ).to_s)
24
24
  so.stdout.lines do |line|
25
25
  case line
26
26
  when /^ProductVersion:\s+(.+)$/
@@ -2,7 +2,7 @@
2
2
  # Author:: Pavel Yudin (<pyudin@parallels.com>)
3
3
  # Author:: Tim Smith (<tsmith@chef.io>)
4
4
  # Copyright:: Copyright (c) 2015 Pavel Yudin
5
- # Copyright:: Copyright (c) 2016 Chef Software, Inc.
5
+ # Copyright:: Copyright (c) Chef Software Inc.
6
6
  # License:: Apache License, Version 2.0
7
7
  #
8
8
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: 2018 Chef Software, Inc.
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -3,7 +3,7 @@
3
3
  # Author:: Benjamin Black (<bb@chef.io>)
4
4
  # Author:: Christopher Brown (<cb@chef.io>)
5
5
  # Author:: Tim Smith (<tsmith@chef.io>)
6
- # Copyright:: Copyright (c) 2009-2016 Chef Software, Inc.
6
+ # Copyright:: Copyright (c) Chef Software Inc.
7
7
  # License:: Apache License, Version 2.0
8
8
  #
9
9
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -114,7 +114,7 @@ Ohai.plugin(:EC2) do
114
114
  end
115
115
 
116
116
  collect_data do
117
- require "base64"
117
+ require "base64" unless defined?(Base64)
118
118
 
119
119
  if looks_like_ec2?
120
120
  logger.trace("Plugin EC2: looks_like_ec2? == true")
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Joe Williams (<joe@joetify.com>)
3
- # Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
3
+ # Copyright:: Copyright (c) Chef Software Inc.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -2,7 +2,7 @@
2
2
  # Author:: Tim Dysinger (<tim@dysinger.net>)
3
3
  # Author:: Benjamin Black (<bb@chef.io>)
4
4
  # Author:: Christopher Brown (<cb@chef.io>)
5
- # Copyright:: Copyright (c) 2009-2016 Chef Software, Inc.
5
+ # Copyright:: Copyright (c) Chef Software Inc.
6
6
  # License:: Apache License, Version 2.0
7
7
  #
8
8
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -6,7 +6,7 @@
6
6
  # Author:: Prabhu Das (<prabhu.das@clogeny.com>)
7
7
  # Author:: Isa Farnik (<isa@chef.io>)
8
8
  # Author:: James Gartrell (<jgartrel@gmail.com>)
9
- # Copyright:: Copyright (c) 2008-2020 Chef Software, Inc.
9
+ # Copyright:: Copyright (c) Chef Software Inc.
10
10
  # Copyright:: Copyright (c) 2015 Facebook, Inc.
11
11
  # License:: Apache License, Version 2.0
12
12
  #
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Matt Wrock (<matt@mattwrock.com>)
3
- # Copyright:: Copyright (c) 2016-2018 Chef Software, Inc.
3
+ # Copyright:: Copyright (c) Chef Software Inc.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -6,7 +6,7 @@
6
6
  # Author:: Doug MacEachern (<dougm@vmware.com>)
7
7
  # Author:: James Gartrell (<jgartrel@gmail.com>)
8
8
  # Author:: Isa Farnik (<isa@chef.io>)
9
- # Copyright:: Copyright (c) 2008-2018, Chef Software Inc.
9
+ # Copyright:: Copyright (c) Chef Software Inc.
10
10
  # Copyright:: Copyright (c) 2009 Bryan McLellan
11
11
  # Copyright:: Copyright (c) 2009 Daniel DeLeo
12
12
  # Copyright:: Copyright (c) 2010 VMware, Inc.
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Caleb Tennis (<caleb.tennis@gmail.com>)
3
- # Copyright:: Copyright (c) 2012-2016 Chef Software, Inc.
3
+ # Copyright:: Copyright (c) Chef Software Inc.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Benjamin Black (<bb@chef.io>)
3
- # Copyright:: Copyright (c) 2009-2016 Chef Software, Inc.
3
+ # Copyright:: Copyright (c) Chef Software Inc.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -4,7 +4,7 @@
4
4
  # Author:: Bryan McLellan (<btm@loftninjas.org>)
5
5
  # Author:: Claire McQuin (<claire@chef.io>)
6
6
  # Author:: James Gartrell (<jgartrel@gmail.com>)
7
- # Copyright:: Copyright (c) Chef Software, Inc.
7
+ # Copyright:: Copyright (c) Chef Software Inc.
8
8
  # Copyright:: Copyright (c) 2009 Bryan McLellan
9
9
  # License:: Apache License, Version 2.0
10
10
  #
@@ -42,7 +42,7 @@ Ohai.plugin(:Kernel) do
42
42
  # @return [Mash]
43
43
  def bsd_modules(path)
44
44
  modules = Mash.new
45
- so = shell_out((Ohai.abs_path(path)).to_s)
45
+ so = shell_out(Ohai.abs_path(path).to_s)
46
46
  so.stdout.lines do |line|
47
47
  # 1 7 0xc0400000 97f830 kernel
48
48
  if line =~ /(\d+)\s+(\d+)\s+([0-9a-fx]+)\s+([0-9a-fx]+)\s+([a-zA-Z0-9\_]+)/
@@ -2,7 +2,7 @@
2
2
  # Cookbook Name:: apache2
3
3
  # Recipe:: default
4
4
  #
5
- # Copyright 2008-2016 Chef Software, Inc.
5
+ # Copyright:: Copyright (c) Chef Software Inc.
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
8
8
  # you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Adam Jacob (<adam@chef.io>)
3
- # Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
3
+ # Copyright:: Copyright (c) Chef Software Inc.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Benjamin Black (<bb@chef.io>)
3
- # Copyright:: Copyright (c) 2009-2016 Chef Software, Inc.
3
+ # Copyright:: Copyright (c) Chef Software Inc.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -25,7 +25,7 @@ Ohai.plugin(:Linode) do
25
25
  # Returns true or false
26
26
  def has_linode_kernel?
27
27
  if ( kernel_data = kernel )
28
- kernel_data[:release].split("-").last =~ /linode/
28
+ kernel_data[:release].split("-").last.include?("linode")
29
29
  end
30
30
  end
31
31
 
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Adam Jacob (<adam@chef.io>)
3
- # Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
3
+ # Copyright:: Copyright (c) Chef Software Inc.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Adam Jacob (<adam@chef.io>)
3
- # Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
3
+ # Copyright:: Copyright (c) Chef Software Inc.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Adam Jacob (<adam@chef.io>)
3
- # Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
3
+ # Copyright:: Copyright (c) Chef Software Inc.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # Author:: Adam Jacob (<adam@chef.io>)
3
3
  # Author:: Chris Read <chris.read@gmail.com>
4
- # Copyright:: Copyright (c) 2008-2017, Chef Software Inc.
4
+ # Copyright:: Copyright (c) Chef Software Inc.
5
5
  # License:: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -141,12 +141,12 @@ Ohai.plugin(:Network) do
141
141
  # using a temporary var to hold routes and their interface name
142
142
  def parse_routes(family, iface)
143
143
  iface.collect do |i, iv|
144
- if iv[:routes]
145
- iv[:routes].collect do |r|
146
- r.merge(dev: i) if r[:family] == family[:name]
147
- end.compact
148
- end
149
- end.compact.flatten
144
+ next unless iv[:routes]
145
+
146
+ iv[:routes].collect do |r|
147
+ r.merge(dev: i) if r[:family] == family[:name]
148
+ end.compact # @todo: when we drop ruby 2.6 this should be a filter_map
149
+ end.compact.flatten # @todo: when we drop ruby 2.6 this should be a filter_map
150
150
  end
151
151
 
152
152
  # determine layer 1 details for the interface using ethtool
@@ -264,7 +264,7 @@ Ohai.plugin(:Network) do
264
264
  end
265
265
  key, val = line.split(/:\s+/)
266
266
  if val
267
- coalesce_key = "#{key.downcase.tr(" ", "_")}"
267
+ coalesce_key = key.downcase.tr(" ", "_").to_s
268
268
  iface[tmp_int]["coalesce_params"][coalesce_key] = val.to_i
269
269
  end
270
270
  end
@@ -289,7 +289,7 @@ Ohai.plugin(:Network) do
289
289
  if val.nil?
290
290
  val = ""
291
291
  end
292
- driver_key = "#{key.downcase.tr(" ", "_")}"
292
+ driver_key = key.downcase.tr(" ", "_").to_s
293
293
  iface[tmp_int]["driver_info"][driver_key] = val.chomp
294
294
  end
295
295
  end
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Adam Jacob (<adam@chef.io>)
3
- # Copyright:: Copyright (c) 2015-2017, Chef Software Inc.
3
+ # Copyright:: Copyright (c) Chef Software Inc.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Thom May (<thom@clearairturbulence.org>)
3
- # Copyright:: Copyright (c) 2009-2016 Chef Software, Inc.
3
+ # Copyright:: Copyright (c) Chef Software Inc.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Adam Jacob (<adam@chef.io>)
3
- # Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
3
+ # Copyright:: Copyright (c) Chef Software Inc.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Adam Jacob (<adam@chef.io>)
3
- # Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
3
+ # Copyright:: Copyright (c) Chef Software Inc.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # Author:: Matt Ray (<matt@chef.io>)
3
3
  # Author:: Tim Smith (<tsmith@chef.io>)
4
- # Copyright:: Copyright (c) 2012-2019 Chef Software, Inc.
4
+ # Copyright:: Copyright (c) Chef Software Inc.
5
5
  # License:: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -2,7 +2,7 @@
2
2
  # Author:: Adam Jacob (<adam@chef.io>)
3
3
  # Author:: Isa Farnik (<isa@chef.io>)
4
4
  # Author:: Richard Manyanza (<liseki@nyikacraftsmen.com>)
5
- # Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
5
+ # Copyright:: Copyright (c) Chef Software Inc.
6
6
  # Copyright:: Copyright (c) 2014 Richard Manyanza.
7
7
  # License:: Apache License, Version 2.0
8
8
  #
@@ -209,4 +209,24 @@ Ohai.plugin(:Packages) do
209
209
  collect_ips_packages
210
210
  collect_sysv_packages
211
211
  end
212
+
213
+ def collect_system_profiler_apps
214
+ require "plist"
215
+ sp_std = shell_out("system_profiler SPApplicationsDataType -xml")
216
+ results = Plist.parse_xml(sp_std.stdout)
217
+ sw_array = results[0]["_items"]
218
+ sw_array.each do |pkg|
219
+ packages[pkg["_name"]] = {
220
+ "version" => pkg["version"],
221
+ "lastmodified" => pkg["lastModified"],
222
+ "source" => pkg["obtained_from"],
223
+ }
224
+ end
225
+ end
226
+
227
+ collect_data(:darwin) do
228
+ packages Mash.new
229
+ collect_system_profiler_apps
230
+ end
231
+
212
232
  end