ohai 14.0.28 → 14.0.29

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a1f5745602a7d261d2346fe002fc0a4dc7fbd4416e762fe32f0bbf90023e3a8
4
- data.tar.gz: 7b0c9a614a3317d7efb17e046d886057974b9af94805eaa41e38652abfee6786
3
+ metadata.gz: 7df4dd6c34ba7a1c5bb097c52ae9e0ffb6a7ce4048d9b1a86c6aaaafa254f121
4
+ data.tar.gz: e00d3d6086d05d0cbb5148fca5a50feb4173a6fbea67308de815e922ba01b19a
5
5
  SHA512:
6
- metadata.gz: fecf7d1a694d21150317858122036b1b88c3914ee6c1ac6559b8cd2af99c68befbceb8ed823eb1baa732357582eb2eee050b183099d27b81872e4efb74ee8a8e
7
- data.tar.gz: 2bf44d42fe0ddd207ac2fbaa9d054efc9d80087d6a32d90b4fba5befbfe30efa29267b415fd2585c6cea673e4fca45187dfe990c98288a28bf925f74f9923324
6
+ metadata.gz: 1cebf6a450da08fc94f2b2ef08b7935acbc4a0e0006d574324ad15282a503454ff5afaa4babd0cb6a959f81a046d06c151bfa0b1f7fdf58fe4b87439ea205090
7
+ data.tar.gz: 29b5fed44d109190a2f1cfcdd52965f8aef6a9d15c74fac2c6412773142041b8433fbbb491072d0a2b54cabeeaad040a60c757196df1655ca1c81fb7ddc3a69d
@@ -28,21 +28,26 @@ Ohai.plugin(:Zpools) do
28
28
 
29
29
  def gather_pool_info
30
30
  pools = Mash.new
31
- # Grab ZFS zpools overall health and attributes
32
- so = shell_out("zpool list -H -o name,size,alloc,free,cap,dedup,health,version")
33
- so.stdout.lines do |line|
34
- case line
35
- when /^([-_0-9A-Za-z]*)\s+([.0-9]+[MGTPE])\s+([.0-9]+[MGTPE])\s+([.0-9]+[MGTPE])\s+(\d+%)\s+([.0-9]+x)\s+([-_0-9A-Za-z]+)\s+(\d+|-)$/
36
- logger.trace("Plugin Zpools: Parsing zpool list line: #{line.chomp}")
37
- pools[$1] = Mash.new
38
- pools[$1][:pool_size] = sanitize_value($2)
39
- pools[$1][:pool_allocated] = sanitize_value($3)
40
- pools[$1][:pool_free] = sanitize_value($4)
41
- pools[$1][:capacity_used] = sanitize_value($5)
42
- pools[$1][:dedup_factor] = sanitize_value($6)
43
- pools[$1][:health] = sanitize_value($7)
44
- pools[$1][:zpool_version] = sanitize_value($8)
31
+ begin
32
+ # Grab ZFS zpools overall health and attributes
33
+ so = shell_out("zpool list -H -o name,size,alloc,free,cap,dedup,health,version")
34
+ so.stdout.lines do |line|
35
+ case line
36
+ when /^([-_0-9A-Za-z]*)\s+([.0-9]+[MGTPE])\s+([.0-9]+[MGTPE])\s+([.0-9]+[MGTPE])\s+(\d+%)\s+([.0-9]+x)\s+([-_0-9A-Za-z]+)\s+(\d+|-)$/
37
+ Ohai::Log.debug("Plugin Zpools: Parsing zpool list line: #{line.chomp}")
38
+ pools[$1] = Mash.new
39
+ pools[$1][:pool_size] = sanitize_value($2)
40
+ pools[$1][:pool_allocated] = sanitize_value($3)
41
+ pools[$1][:pool_free] = sanitize_value($4)
42
+ pools[$1][:capacity_used] = sanitize_value($5)
43
+ pools[$1][:dedup_factor] = sanitize_value($6)
44
+ pools[$1][:health] = sanitize_value($7)
45
+ pools[$1][:zpool_version] = sanitize_value($8)
46
+ end
45
47
  end
48
+
49
+ rescue Ohai::Exceptions::Exec
50
+ Ohai::Log.debug('Plugin Zpools: Could not shell_out "zpool list -H -o name,size,alloc,free,cap,dedup,health,version". Skipping plugin.')
46
51
  end
47
52
  pools
48
53
  end
@@ -82,6 +87,6 @@ Ohai.plugin(:Zpools) do
82
87
  end
83
88
 
84
89
  # Set the zpools data
85
- zpools pools
90
+ zpools pools unless pools.empty?
86
91
  end
87
92
  end
@@ -18,5 +18,5 @@
18
18
 
19
19
  module Ohai
20
20
  OHAI_ROOT = File.expand_path(File.dirname(__FILE__))
21
- VERSION = "14.0.28"
21
+ VERSION = "14.0.29"
22
22
  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: 14.0.28
4
+ version: 14.0.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Jacob
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-17 00:00:00.000000000 Z
11
+ date: 2018-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: systemu
@@ -542,7 +542,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
542
542
  version: '0'
543
543
  requirements: []
544
544
  rubyforge_project:
545
- rubygems_version: 2.7.4
545
+ rubygems_version: 2.7.5
546
546
  signing_key:
547
547
  specification_version: 4
548
548
  summary: Ohai profiles your system and emits JSON