ohai 17.5.2 → 17.6.0

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: afaf1b3332e2a31c5d045ea50e9315bd9fcf64fcd21e120982974c5b9d167d76
4
- data.tar.gz: ed90edfe09e2bf83fea9018b7f16d3fd16caf28aa998e75e44c9980789df6d30
3
+ metadata.gz: 98c016d2839114bfe15deee549cf97ba8ff627ab2931207a105a42a154746cc7
4
+ data.tar.gz: '06687f5ca824b9489e3140b19415ae8c99e1afefc053d9c4519b4d7af9d85cf8'
5
5
  SHA512:
6
- metadata.gz: e4693d375412563df16856fe88ccdfd83ba5279a9b33fb3856ea9a7299bc599c943d7360d7135d28a59543420456a250300ad416a5e93bb7b09f7041750c336c
7
- data.tar.gz: ee963b18a46ea9b8a2d3292be0f82a2aaa7ef90cb629a71eb1fe51a661b5ded47d8da4c9b44f35614d169b6e0922dba3aa5e966ceab7055dcef8e57b50fc7afa
6
+ metadata.gz: 7a8b2890b42b09e33d01a67ff589f587029d052a7a55a2ba09d1f2dd482afce275201e06cf968492f0645b8273f9b69890c7f082af878883ee66bc615828a96a
7
+ data.tar.gz: 3de0474524e3e9825e74f645630fc9e721f2ddbecd2a16bb337a21a02fa25d25cab469a5a810e8e2461ed137aab78f03abde064887993f64c784399b0ab8bdd9
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.0.9"
12
+ gem "chefstyle", "2.1.0"
13
13
  gem "ipaddr_extensions"
14
14
  gem "rake", ">= 10.1.0"
15
15
  gem "rspec-collection_matchers", "~> 1.0"
@@ -0,0 +1,61 @@
1
+ #
2
+ # Author:: Matthew Massey <matthewmassey@fb.com>
3
+ # Copyright:: Copyright (c) 2021 Facebook
4
+ # License:: Apache License, Version 2.0
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
19
+ Ohai.plugin(:Tc) do
20
+ provides "tc"
21
+ optional true
22
+
23
+ collect_data(:linux) do
24
+ tc_path = which("tc")
25
+ if tc_path
26
+ cmd = "#{tc_path} qdisc show"
27
+ tc_output = shell_out(cmd)
28
+
29
+ tc_data = Mash.new
30
+ tc_data[:qdisc] = Mash.new
31
+
32
+ tc_output.stdout.split("\n").each do |line|
33
+ line = line.strip
34
+ if /dev (\w+)/ =~ line
35
+ dev = $1
36
+ tc_data[:qdisc][dev] ||= Mash.new
37
+ else
38
+ next
39
+ end
40
+ if /qdisc (\w+)/ =~ line
41
+ qdisc = $1
42
+ tc_data[:qdisc][dev][:qdiscs] ||= []
43
+ tc_data[:qdisc][dev][:qdiscs] << Mash.new
44
+ qdisc_idx = tc_data[:qdisc][dev][:qdiscs].length - 1
45
+ tc_data[:qdisc][dev][:qdiscs][qdisc_idx] ||= Mash.new
46
+ tc_data[:qdisc][dev][:qdiscs][qdisc_idx][:type] = qdisc
47
+ tc_data[:qdisc][dev][:qdiscs][qdisc_idx][:parms] ||= Mash.new
48
+ else
49
+ next
50
+ end
51
+ if qdisc == "fq" && /buckets (\d+)/ =~ line
52
+ buckets = $1.to_i
53
+ tc_data[:qdisc][dev][:qdiscs][qdisc_idx][:parms][:buckets] = buckets
54
+ end
55
+ end
56
+ tc tc_data
57
+ else
58
+ logger.trace("Plugin Tc: Could not find tc. Skipping plugin.")
59
+ end
60
+ end
61
+ 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.5.2"
22
+ VERSION = "17.6.0"
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.5.2
4
+ version: 17.6.0
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-08-27 00:00:00.000000000 Z
11
+ date: 2021-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef-config
@@ -315,6 +315,7 @@ files:
315
315
  - lib/ohai/plugins/linux/sessions.rb
316
316
  - lib/ohai/plugins/linux/sysctl.rb
317
317
  - lib/ohai/plugins/linux/systemd_paths.rb
318
+ - lib/ohai/plugins/linux/tc.rb
318
319
  - lib/ohai/plugins/linux/virtualization.rb
319
320
  - lib/ohai/plugins/lua.rb
320
321
  - lib/ohai/plugins/mono.rb